← Back to Home • Next: MultiSelect Control →
Select<T> paints its output in named regions. Each region is a SelectStyles value you can recolor
per control instance.
ℹ️ Styling is per control — there is no global “style all selects” API. The only style-related global setting is
PromptPlus.Config.ContrastRatio.
SelectStyles 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 focused / selected item |
UnSelected |
The non-focused items |
Disabled |
Items marked non-selectable |
Error |
The validation error line |
Pagination |
The page indicator |
TaggedInfo |
The extra-info text (ExtraInfo) |
Tooltips |
The keyboard-hint line |
Lines |
Separator lines (AddSeparator) |
GroupTip |
The current-group hint for grouped lists |
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
.Select<string>("City")
.AddItems(["Seattle", "London", "Tokyo"])
.Styles(SelectStyles.Prompt, Color.Yellow)
.Styles(SelectStyles.Description, Color.Red)
.Styles(SelectStyles.Selected, new Style(Color.Blue, Color.Default))
.Run();
To reuse a theme across selects, 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