← Back to Home • Next: Task Control →
The ProgressBar control paints its output in named regions. Each region is a ProgressBarStyles
value you can recolor per control instance.
ℹ️ Styling is per control — there is no global “style all progress bars” API. Set styles on each control (or through a small helper you reuse). The only style-related global setting is
PromptPlus.Config.ContrastRatio.
ProgressBarStyles regions| Region | What it paints |
|---|---|
Prompt |
The prompt text |
Answer |
The current value shown next to the prompt |
Description |
The description line (including ChangeDescription output) |
Tooltips |
The keyboard-hint line |
Spinner |
The animated spinner |
Slider |
The bar track / filled portion |
Ranger |
The min/max range text |
Error |
The error line |
The
Slidercolor is whatChangeColorandChangeGradientoverride dynamically per value. A staticStyles(ProgressBarStyles.Slider, …)sets the base color when no dynamic color is configured.
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
.ProgressBar("Wait Progress: ")
.Styles(ProgressBarStyles.Slider, new Style(Color.Green, Color.Default)) // bar color
.Styles(ProgressBarStyles.Ranger, Color.Grey) // range text
.Styles(ProgressBarStyles.Error, new Style(Color.Red, Color.Default)) // error line
.UpdateHandler(Work)
.Run();
To reuse a theme across bars, 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 = 0; // disable
PromptPlus.Config.ContrastRatio = 4.5; // WCAG AA target
Style type, per-control styling, contrastStyle API and Overflow