CamoStepper
A whole-number quantity with − and + buttons: cart lines, guests. The buttons disable at the ends of range,
and holding one repeats, faster over time. With allowTyping the value is a number field, clamped to range
and snapped to step when focus leaves. Screen readers get three stops: "Decrease label", the value, and
"Increase label"; each change is announced. valueText formats the value ("3 nights").
API
- Kotlin
- Dart
public fun CamoStepper(
value: Int,
onValueChange: (Int) -> Unit,
modifier: Modifier = Modifier,
range: IntRange = 0..Int.MAX_VALUE,
step: Int = 1,
label: String? = null,
allowTyping: Boolean = true,
valueText: ((Int) -> String)? = null,
error: String? = null,
enabled: Boolean = true,
)
| Name | Type | Default |
|---|---|---|
value | Int | required |
onValueChange | (Int) -> Unit | required |
modifier | Modifier | Modifier |
range | IntRange | 0..Int.MAX_VALUE |
step | Int | 1 |
label | String? | null |
allowTyping | Boolean | true |
valueText | ((Int) -> String)? | null |
error | String? | null |
enabled | Boolean | true |
Design notes
Why CamoStepper works this way, its states and its edge cases: contributor docs.