← Back to Home • Next: Slider — Styles →
How the Slider control behaves while it is running: keyboard, how the value steps, ranges and
precision, colors and gradients, layout, history, and the details that matter in real apps.
Select value 65 ← prompt + live answer (same line)
Current selection: 65 % ← description (optional / dynamic)
0 [██████████████░░░░░░░░] 100 ← range · bar (LeftRight layout)
Left/Right: change Enter: confirm Esc ← tooltip (toggle with F1 / Ctrl+F1)
FractionalDigits and
Culture.0 … 100) and the min/max display can be hidden with
HideElements.BarType
and colored by ChangeColor / ChangeGradient.Every region can be recolored — see Styles.
The keys that change the value depend on the Layout.
LeftRight layout (default — horizontal bar)| Key | Action |
|---|---|
← / → |
Decrease / increase by one Step |
Shift+Tab / Tab |
Decrease / increase by one LargeStep |
UpDown layout (vertical, no bar)| Key | Action |
|---|---|
↓ / ↑ |
Decrease / increase by one Step |
Shift+Tab / Tab |
Decrease / increase by one LargeStep |
| Key | Action |
|---|---|
Enter |
Confirm — returns the current value |
Esc |
Abort (when the abort key is enabled) → IsAborted == true, Content == null |
F1 |
Cycle tooltip content |
Ctrl+F1 |
Show / hide the tooltip |
⚠️ There is no
Home/End-to-min/max binding, andPage Up/Page Downdo not trigger the large step —Tab/Shift+Tabdo. There is also no F3 interactive history list like Input/Secret have;EnableHistoryon Slider is passive — it only pre-loads the last confirmed value as the next run’sDefault, nothing more.
Range — you can never move below the minimum
or above the maximum, but there’s no dedicated jump-to-min/max key; repeatedly pressing Tab/
Shift+Tab (or the arrow keys) is the only way there.Step; Tab/Shift+Tab apply the larger
LargeStep.Step defaults to 1/100 of the range and LargeStep to 1/10 of the
range. For the default 0..100 range that is 1 and 10.FractionalDigits decimals and
formatted with the active Culture (so pt-BR shows a comma separator).💡 Choose a
Stepthat is a meaningful increment for your domain — for example5for a percentage picked in fives — so keyboard navigation feels natural.
Two independent ways to color the bar:
ChangeColor(Func<double, Style>) recomputes the bar Style from the
current value — ideal for thresholds (red below 30, gold above 70).ChangeGradient(params Color[]) blends the supplied colors smoothly
across the bar as the value grows.Both react as the value changes. Use one or the other per control.
Layout(SliderLayout.UpDown) is more than a rotation:
[min,max] range display is still shown next to the answer by default — hide it too with
HideElements(HideSlider.Range) if you want a bare value.The default LeftRight layout shows the full bar and uses the Left / Right arrows.
When EnableHistory(filename, …) is set:
filename.Default(value, useDefaultHistory: true), the last saved value is
pre-loaded as the starting position instead of value.IHistoryOptions (expiration, max items, and so on) governs what is retained.Unlike Input/Secret, Slider has no interactive history list — there’s no F3 hotkey and no
Pagination/Selected/UnSelected history browsing UI. History here is purely passive: it just
remembers the last confirmed value for next time.
You can also manage a history store directly with PromptPlus.Controls.History(filename) — add,
save, or remove entries programmatically (used in the samples to seed reproducible data).
Set per instance via Options(...), or globally on
PromptPlus.Config:
| Option | Effect on Slider |
|---|---|
EnabledAbortKey(false) |
Removes Esc — the user must confirm |
HideAfterFinish(true) |
Erases the bar after confirm — the whole control is erased, not just the interactive part |
HideOnAbort(true) |
Erases the bar after Esc |
ShowTooltip(false) |
Hides the keyboard hint line |
Description(...) |
Overrides the description text |
The global
PromptPlus.Config.SliderWidthsets the default bar width; override it per control withWidth.
Content == null, not the seeded Default. Always branch on
IsAborted before reading the value.Default must sit inside the range — a value outside min/max throws
InvalidOperationException when the control runs, not ArgumentOutOfRangeException.FractionalDigits; more decimals are
not preserved beyond it.Options, SliderWidth