MosaicSlider

fun MosaicSlider(value: Float, onValueChange: (Float) -> Unit, colors: MosaicSliderColors, modifier: Modifier = Modifier, enabled: Boolean = true, valueDistribution: SliderValuesDistribution = SliderValuesDistribution.Linear, range: ClosedFloatingPointRange<Float> = 0f..1f, disabledRange: ClosedFloatingPointRange<Float> = EmptyRange, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, thumb: @Composable (MosaicSliderState) -> Unit = { DefaultSliderThumb(colors = colors, enabled = enabled) })

A composable function that creates a slider UI component.

Parameters

value

the current value of the slider

onValueChange

a callback function invoked when the slider value changes

enabled
  • determines whether the user can interact with the slide or not

colors

the colors used to customize the appearance of the slider

modifier

the modifier to be applied to the slider

valueDistribution

the strategy for distributing slider values

range

the range of values the slider can represent

interactionSource

the interaction source used to handle user input interactions

thumb

the composable function used to render the slider thumb


fun MosaicSlider(state: MosaicSliderState, colors: MosaicSliderColors, modifier: Modifier = Modifier, enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, thumb: @Composable (MosaicSliderState) -> Unit = { DefaultSliderThumb(colors = colors, enabled = enabled) })

A composable function that creates a slider UI component.

Parameters

state

of the Slider where the latest slider value is stored

colors

the colors used to customize the appearance of the slider

modifier

the modifier to be applied to the slider.

enabled
  • determines whether the user can interact with the slide or not

interactionSource

the interaction source used to handle user input interactions

thumb

the composable function used to render the slider thumb