CamoSlider
A value from a continuous or stepped range: volume, a price filter. A tap jumps to the touched value and a
drag follows the finger; steps stops lie between the ends (0 = continuous). onValueChangeFinished fires
once per gesture or key press, so an app can save once. label names it for screen readers ("Volume"), and
valueLabel gives the value's text, shown on the thumb while dragging. The parent sets the width.
API
- Kotlin
- Dart
public fun CamoSlider(
value: Float,
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
range: ClosedFloatingPointRange<Float> = 0f..1f,
steps: Int = 0,
onValueChangeFinished: (() -> Unit)? = null,
valueLabel: ((Float) -> String)? = null,
label: String? = null,
enabled: Boolean = true,
interactionSource: MutableInteractionSource? = null,
)
| Name | Type | Default |
|---|---|---|
value | Float | required |
onValueChange | (Float) -> Unit | required |
modifier | Modifier | Modifier |
range | ClosedFloatingPointRange<Float> | 0f..1f |
steps | Int | 0 |
onValueChangeFinished | (() -> Unit)? | null |
valueLabel | ((Float) -> String)? | null |
label | String? | null |
enabled | Boolean | true |
interactionSource | MutableInteractionSource? | null |
Design notes
Why CamoSlider works this way, its states and its edge cases: contributor docs.