Stylish Slider
A slider for selecting a single value from a continuous or stepped range, wrapping the Material 3 Slider with Stylish defaults.
Use a slider when the exact value is secondary to the position along a range (volume, brightness, price). For selecting both endpoints of a range use StylishRangeSlider, and for a stepped on/off choice prefer StylishSwitch or StylishCheckbox.
Parameters
Current value of the slider. Coerced to valueRange if outside of it.
Called with the new value while the user drags or taps the track.
Modifier applied to the Slider root. The root carries the default test tag stylish_slider for UI tests; callers can override it by passing their own Modifier.testTag(...) here.
When false, the slider ignores pointer input and renders in the disabled color scheme.
Range of values the slider can take. Defaults to 0f..1f.
If positive, the number of discrete steps between the endpoints of valueRange. For example, 0f..10f with 4 steps allows 2, 4, 6, and 8. 0 makes the slider continuous.
Called when the user completes a drag or tap. Use this for expensive operations; update the value in onValueChange.
SliderColors for each state. Defaults to a primary thumb and active track with a MaterialTheme.colorScheme.surfaceVariant inactive track.
Optional hoisted MutableInteractionSource for observing interactions with the slider. When null, an internal instance is remembered.