androidx.compose.material3

rememberRangeSliderStateSince 1.9

Function

No hand-written docs yet.

Creates a SliderState that is remembered across compositions.

Parameters

@Composable
fun rememberRangeSliderState(
    activeRangeStart: Float = 0f,
    activeRangeEnd: Float = 1f,
    steps: Int = 0,
    onValueChangeFinished: (() -> Unit)? = null,
    valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
): RangeSliderState

activeRangeStart: FloatOptional

Default: 0f

Float that indicates the initial start of the active range of the slider. If outside of valueRange provided, value will be coerced to this range.

activeRangeEnd: FloatOptional

Default: 1f

Float that indicates the initial end of the active range of the slider. If outside of valueRange provided, value will be coerced to this range.

steps: IntOptional

Default: 0

if positive, specifies the amount of discrete allowable values between the endpoints of valueRange. For example, a range from 0 to 10 with 4 steps allows 4 values evenly distributed between 0 and 10 (i.e., 2, 4, 6, 8). If steps is 0, the slider will behave continuously and allow any value from the range. Must not be negative.

onValueChangeFinished: (() -> Unit)?Optional

Default: null

lambda to be invoked when value change has ended. This callback shouldn't be used to update the range slider values (use RangeSliderState.onValueChange for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.

valueRange: ClosedFloatingPointRange<Float>Optional

Default: 0f..1f

range of values that Range Slider values can take. activeRangeStart and activeRangeEnd will be coerced to this range.

Library docs

Creates a SliderState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.