MotionNumber
A number whose places roll like wheels.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | bigint | string | —required | The number, or caller-formatted numeric text. |
mode | 'replace' | 'roll' | 'replace' | replace moves each changed place one step; roll passes through the digits in between. |
direction | 'auto' | 'digit' | 'up' | 'down' | 'auto' | auto follows the change in size so carries roll one way; digit compares each place on its own. |
stagger | number | 45 | Milliseconds between changed places, from the units outward. The whole ripple is bounded. |
format | (value) => string | Intl.NumberFormatOptions | A function that returns the text to show, or Intl.NumberFormat options (with intl). | |
intl | boolean | false | Use the built-in Intl.NumberFormat. Off by default so no runtime needs Intl. |
locale | string | string[] | Locale for intl. | |
prefix | string | Text before the number. | |
suffix | string | Text after the number. | |
transition | Transition | spring | A timing curve { duration, easing } or a spring { tempo: 'spring', spring }. Springs keep their momentum when interrupted. |
onMotionComplete | (value) => void | Runs with the value once the places have settled. |