JengaSlider

fun JengaSlider(value: Float, onValueChange: (Float) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, valueRange: ClosedFloatingPointRange<Float> = 0f..1f, colors: JengaSliderColors = JengaSliderDefaults.colors())(source)

A horizontal slider for choosing a value in a range. Drag the thumb to change.

Parameters

value

the current value (within valueRange).

onValueChange

called with the new value as the thumb moves.

modifier

the Modifier for this slider.

enabled

whether the slider is interactive.

valueRange

the inclusive value range; defaults to 0f..1f.

colors

the color set; defaults to JengaSliderDefaults.colors.

Samples

var value by remember {
    androidx.compose.runtime.mutableFloatStateOf(
        value = 0.5f,
    )
}
JengaSlider(
    value = value,
    onValueChange = { value = it },
)