← Back to Material Compose
<a href="https://material.io/components/sliders" class="external" target="_blank">Material Design slider</a>.
Range Sliders expand upon Slider using the same concepts but allow the user to select 2 values.
The two values are still bounded by the value range but they also cannot cross each other.
Use continuous Range Sliders to allow users to make meaningful selections that don’t require a specific values:
@Composable @ExperimentalMaterialApi fun RangeSlider( value: ClosedFloatingPointRange<Float>, onValueChange: (ClosedFloatingPointRange<Float>) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, valueRange: ClosedFloatingPointRange<Float> = 0f..1f, @IntRange(from = 0) steps: Int = 0, onValueChangeFinished: (() -> Unit)? = null, colors: SliderColors = SliderDefaults.colors() )
|current values of the RangeSlider. If either value is outside of valueRange provided, it will be coerced to this range.|
|lambda in which values should be updated|
|modifiers for the Range Slider layout|
|whether or not component is enabled and can we interacted with or not|
|range of values that Range Slider values can take. Passed value will be coerced to this range|
|if greater than 0, specifies the amounts of discrete values, evenly distributed between across the whole value range. If 0, range slider will behave as a continuous slider and allow to choose any values from the range specified. Must not be negative.|
|lambda to be invoked when value change has ended. This callback shouldn't be used to update the range slider values (use onValueChange for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.|
|SliderColors that will be used to determine the color of the Range Slider parts in different state. See SliderDefaults.colors to customize|