Skip to contentKino
Skip to Content

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.json
Share on

Examples

Team plan

Kino for everyone who writes, reviews or ships.
You save $360.00 a year
12 seats × $11.50a month
Total$1,656.00 / year

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.

Paying members9,806

Spin

Each digit spins through the digits between, the way an odometer does, so a bigger change travels further.

Workspace billing

Revenue$76,905.25
Paying members3,174
Trial to paid4.1%

Count

The whole number counts through the values between and never goes past the new one. Pick a range or refresh.

Team plan by region

12 seats, billed in local currency
Germanyde-DE
144,00 €
Francefr-FR
144,00 €
Indiaen-IN
₹11,988.00
Egyptar-EG
‏٤٬٧٨٨٫٠٠ ج.م.‏
Israelhe-IL
‏540.00 ‏₪
Japanja-JP
¥21,600

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

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

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Props

PropTypeDefaultDescription
valuenumberNoneThe number to show. It moves to each new value.
variant"roll""spin""count""roll"How it moves: each changed digit rolls to its new one, spins through the digits between, or the whole number counts through the values between.
localeIntl.LocalesArgumentthe browser’sThe locale it is written in. Give one when the page is rendered on the server, so the server and the browser write it the same way.
formatIntl.NumberFormatOptionsNoneHow it is written: a currency, a percentage, a unit, compact, how many decimals.

CSS variables

VariableSet it onDefaultDescription
--swap-rollAnimatedNumber, or anything above it0.75emHow far a sign, currency or unit rolls when it changes (Roll and Spin).

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.