Slider
Slider edits a controlled floating-point value.
Its default range is 0.0F through 1.0F.
Control value and range
Section titled “Control value and range”Row { Slider(volume) .Range(0.0F, 100.0F) .Step(1.0F) .OnChanged([volume](float next) { volume = next; }), Text::Format("{}%", static_cast<int>(volume)),}.With( Spacing(12.0F), CrossAlign(CrossAxisAlignment::Center)).Range(minimum, maximum) defines the legal interval.
.Step(step) snaps requested values to discrete increments.
The caller must feed accepted values back into the next composition.
Interaction and accessibility
Section titled “Interaction and accessibility”Pointer dragging, keyboard range adjustment, focus, and accessibility increment or decrement actions share the same controlled output path.
The slider exposes role, current range, optional step, enabled state, and focus semantics automatically.
Theme behavior
Section titled “Theme behavior”SliderStyle lets a theme vary track gaps, tick treatment, stop indicators, thumb geometry, colors, focus treatment, and motion without changing the controlled value contract.
- Constructors:
Slider(float)andSlider(State<float>). - Fluent methods:
.Range(float minimum, float maximum),.Step(float). - Event:
.OnChanged(function)withfloat. - Theme style:
SliderStyle.
Use ProgressBar when the value is display-only.

