Components / effect

Number Roll

v1.0.0 · premium

A number whose digits roll like an odometer to their value when it scrolls into view, or when the value changes.

Number Roll demo

Implementation

A number whose digits roll like an odometer to their value when it scrolls into view, or when the value changes.

Framework
React 19.3.1 with TypeScript
Motion
Native CSS and browser APIs. No GSAP required.
Available modes
build
Version
1.0.0 · published

Source code

Download source ZIP
export function NumberRoll({ value, duration = 1600, locale, decimals = 0, prefix = '', suffix = '', ink, className }: {
  value: number;
  /** Length of the roll in milliseconds. Each digit starts a little after the one to its left. */

Quality evidence

Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .

Changelog

v1.0.0 · A number whose digits roll like an odometer to their value when it scrolls into view, or when the value changes.

Frequently asked questions

What does a visitor see without JavaScript?

The real number. The component renders the final digits and only drops them to zero in the browser, just before the first paint, when motion is allowed.

Can it format currency or other locales?

Yes. It uses Intl.NumberFormat, so pass a locale, a number of decimals, and a prefix or suffix such as a currency symbol.