Animated number
A number that moves to its new value when it changes, written for its locale. Each digit that changed rolls to its new one, spins through the digits between, or the whole number counts.
npx shadcn add https://kinoui.com/r/animated-number.jsonCopy install command
Examples
Default
Each digit that changed rolls to its new one, up when the value grew. Add seats or switch the billing to see the totals follow.
Spin
Each digit spins through the digits between, the way an odometer does, so a bigger change travels further.
Workspace billing
Count
The whole number counts through the values between and never goes past the new one. Pick a range or refresh.
Formats
Any Intl.NumberFormat options, in any locale: the digits line up on the decimal point, and the currency sits where the locale puts it.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/animated-number.json- Files
lib/number-format.tslib/reduce-motion.tslib/resize.tslib/roll.tsxlib/refs.tslib/swap.tsxlib/run-progress.tscomponents/kino/animated-number.tsx- Packages
@base-ui/react- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
CSS variables
Accessibility
- A screen reader hears the value once, as it is written, never the numbers in between. The number drawn on screen is hidden from it and can’t be selected, so a copy gives the value too.
- It isn’t a live region, so a change isn’t announced on its own. Where a change matters, such as a total after an edit, put the value in a
role="status"region of your own. - Digits are all one width, so nothing beside the number moves as its digits change, only when it gains or loses one.
- When the system asks for less motion, nothing rolls, spins or counts: Roll fades the new digits in, and Spin and Count show the new value at once.