NumberTicker
Counts to a number with a spring.
Animatedimport { NumberTicker } from 'umbra-ui/motion'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value required | number | — | Number to count to. Changing it animates from the current value. |
duration | number | 2 | Seconds the count takes. |
format | NumberFormatOptions | — | `Intl.NumberFormat` options (currency, percent, fraction digits…). |
from | number | 0 | Number to start from. |
locale | string | — | BCP 47 locale for formatting. Defaults to the runtime locale. |
reducedMotion | "system" | "always" | "never" | "system" | Reduced-motion override. Under reduced motion the final value is shown immediately. |
trigger | "mount" | "inView" | inView | Start on mount, or when scrolled into view. |
Usage notes
Formats with Intl.NumberFormat. Changing value animates from the current number.
Accessibility
- Screen readers only get the final value, never the intermediate numbers.
- Under reduced motion the final value is shown immediately.
Import
import { NumberTicker } from 'umbra-ui/motion';
import 'umbra-ui/styles.css'; // once, at the root of your app