Stepper
A number nudged up and down.
Import
import {Stepper} from '@hzblj/kara-ui'Props
A number with minus and plus buttons beside a label: SwiftUI's Stepper on iOS; on Android the label, the value and two icon buttons in a row. A native atom — it renders inside <Screen> or <Island>.
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | string | — | The leading text. iOS shows only the label, not the value — put the value in it if it should be seen. Android shows the value between its buttons. |
| onValueChange* | (value: number) => void | — | A button was pressed; it passes the new value, kept within |
| value* | number | — | The current value. Update it from |
| max | number | Android Number.MAX_SAFE_INTEGER | The highest value. When unset, Android has no upper limit and iOS stops at |
| min | number | Android Number.MIN_SAFE_INTEGER | The lowest value. When unset, Android has no lower limit and iOS stops at |
| step | number | 1 | How much one press adds or takes away. |
The leading text. iOS shows only the label, not the value — put the value in it if it should be seen. Android shows the value between its buttons.
A button was pressed; it passes the new value, kept within min and max.
The current value. Update it from onValueChange. iOS's native stepper counts in whole numbers.
The highest value. When unset, Android has no upper limit and iOS stops at 100.
The lowest value. When unset, Android has no lower limit and iOS stops at 0.
How much one press adds or takes away. 1 by default.
Platform notes
- Without
minandmax, iOS stops at 0 and 100 and Android has no limits — set both. - iOS steps in whole numbers.