Animated number
Animates a number when its value changes.
Views today
1,284animated-number-basic-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Digit slide
Set variant="slide" to move only the digits that change.
Open tasks
198animated-number-slide-demo.tsx
Number format
Set locale and formatOptions. Screen readers hear the same format.
Monthly budget
1.249,50 €animated-number-format-demo.tsx
API reference
- value: numberRequired
- The number to show. A change animates. Screen readers get the new value at once. A number wider than its container wraps.
- variant: "count" | "slide" = "count"
- count counts to the new value. slide moves only the digits that change.
- locale: string = "en-US"
- Locale for the number format.
- formatOptions: Intl.NumberFormatOptions = { maximumFractionDigits: 0 }
- Options for Intl.NumberFormat, such as a currency or a unit.