Dot Stepper
The number is set in the 5 x 7 dot face, and when it changes only the digits that changed roll, up for more and down for less, lit in the accent as they go. Hold a button and it repeats, faster the longer it's held; click the number to type one. Real buttons and a real spinbutton lie under the drawing, so the arrow keys, Page Up and Down, Home and End and screen readers all work.
Needs: None. Canvas 2D over native buttons and a field.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | – | The number. Leave unset to let the stepper keep its own. |
| defaultValue | number | – | The number at first, when value isn't set. |
| onChange | (value: number) => void | – | Called with the new number as it changes. |
| min | number | 0 | The lowest number. |
| max | number | 99 | The highest number. |
| step | number | 1 | How much a press changes it. |
| tone | string | – | A pressed button and rolling digits. The page's accent by default. |
| pitch | number | 3 | Size of one dot in px. The stepper is 13 dots tall. |
| disabled | boolean | false | Can't be changed. |
| label | string | "Number" | What the number is, for screen readers. |
| className | string | – | Class on the stepper. |
| style | CSSProperties | – | Style on the stepper. |