Skip to content

Animated number

Animates a number when its value changes.

Views today

1,284
animated-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.

Digit slide

Set variant="slide" to move only the digits that change.

Open tasks

198
animated-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.