Animated Number
A slot-machine counter: every digit rolls independently on a spring. Locale-aware through Intl.NumberFormat.
Data Display
Playground
Tweak the props, the preview and the code follow.
Props
1284
<AnimatedNumber value={1284} />Installation
npx @plumsydev/plum-ui add animated-numberUsage
import { AnimatedNumber } from "@/components/ui/animated-number"<AnimatedNumber
value={1299.9}
format={{ style: "currency", currency: "EUR" }}
locales="fr-FR"
/>Examples
Currency & sign
Any Intl.NumberFormat option works — currency, sign, decimals, locales.
ACME · Live
Dashboard stats
Percent and compact notation, rolling up from zero on mount.
Visitors
Bounce rate
Revenue
API Reference
AnimatedNumber
| Prop | Type | Default |
|---|---|---|
value*The number to display. | number | — |
formatFormatting options passed to Intl.NumberFormat. | Intl.NumberFormatOptions | — |
localesLocale(s) used for formatting. | Intl.LocalesArgument | "en-US" |
transitionMotion transition used by every digit. | Transition | spring.smooth |
Notes
- Digits are keyed by their position from the right, so units stay units when the number gains a digit.
- The full formatted value is exposed through
aria-label; the rolling columns are hidden from assistive tech.