← Back to Home • Next: Timer Control →
Calendar paints its output in named regions. Each region is a CalendarStyles value you can
recolor per control instance.
ℹ️ Styling is per control — there is no global “style all calendars” API. The only style-related global setting is
PromptPlus.Config.ContrastRatio.
CalendarStyles regions| Region | What it paints |
|---|---|
Prompt |
The prompt text |
Answer |
The confirmed answer shown after .Run() |
Description |
The description line under the prompt |
Selected |
The highlighted (cursor) day |
UnSelected |
The non-focused days |
Disabled |
Days blocked by DisableDates / DisabledWeekend or outside Range |
Error |
The validation error line |
Pagination |
The notes page indicator |
Tooltips |
The keyboard-hint line |
Lines |
The grid lines |
CalendarHighlight |
Days marked by Highlights |
CalendarDay |
The day numbers in the grid |
CalendarMonth |
The month name in the header |
CalendarYear |
The year in the header |
CalendarWeekDay |
The week-day header row |
Use the fluent Styles method. A Style is a foreground color, a background
color, and an Overflow strategy — there is no bold/italic/underline. A bare Color is accepted
as shorthand for a foreground-only style.
using ConsolePlusLibrary;
using PromptPlusLibrary;
PromptPlus.Controls
.Calendar("Date")
.Styles(CalendarStyles.Lines, Color.Blue)
.Styles(CalendarStyles.Selected, Color.Green)
.Styles(CalendarStyles.CalendarDay, Color.Yellow)
.Styles(CalendarStyles.CalendarHighlight, Color.Blue)
.Styles(CalendarStyles.CalendarMonth, Color.Green)
.Styles(CalendarStyles.CalendarWeekDay, Color.Aqua)
.Styles(CalendarStyles.CalendarYear, Color.Violet)
.Styles(CalendarStyles.Selected, new Style(Color.Green, Color.Default))
.Run();
To reuse a theme across calendars, wrap the styling in a helper you call for each control — the library does not broadcast styles for you. See Global Styles for the pattern.
PromptPlus nudges foreground colors that fall below the configured contrast ratio so text stays
readable on any terminal theme. Tune or disable with PromptPlus.Config.ContrastRatio.
Style type, per-control styling, contrastStyle API and Overflow