Skip to content

Slider

@Composable



fun Slider(
    value: Float, 
    onValueChange: (Float) -> Unit, 
    modifier: Modifier = Modifier, 
    enabled: Boolean = true, 
    variant: String = ThemeVariants.DEFAULT, 
    steps: Int = 0, 
    onValueChangeFinished: () -> Unit = {}
)

A standard themed horizontal slider, drawing a "slider" track, "slider_handle" thumb, and "slider_fill" progress fill up to the thumb, all from the current theme.

Parameters

  • value: The current value, normalized/snapped via snapSliderValue.

  • onValueChange: Called with the new normalized value on every drag/click update.

  • modifier: Additional modifiers applied to the outer container.

  • enabled: When false, the disabled state is drawn and input is ignored.

  • variant: The theme variant used for both the track and thumb textures.

  • steps: Number of discrete increments to snap to; 0 means continuous.

  • onValueChangeFinished: Called once when a drag interaction ends (on release).