Skip to content

Number Ticker for React

A number ticker for React where every digit is a little wheel that rolls to its new value, formatted with Intl.NumberFormat. Use it as an animated counter for KPI tiles and dashboard totals that change when a date range or filter changes, so each digit rolls to its new value like an odometer.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/number-ticker.json

Monthly revenue

$12,480

402,118 users

Live stats

Digits roll up when a value rises and down when it falls; new places slide in. Places that went through a full cycle spin an extra turn, like an odometer.

Revenue

$48,250

Active users

1.3M

Conversion

4.8%

Seats taken

98

Files to copy

5 folders · 5 files · 3 packages
From theme/src/
  • components/number-ticker/
  • hooks/{use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{canvas-effects.ts, cn.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/number-ticker.jsonRegistry item: number-ticker. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/glass-card/
  • motion/light-follower.ts
  • lib/heading.ts
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/glass-card.json
Packages
pnpm add clsx motion tailwind-merge

Any locale, any numbering system

The same value through Intl.NumberFormat: separators, symbols and even the digits themselves follow the locale. In right-to-left locales the digits still read left to right, and the currency sits where the browser puts it.

German, euro
1.234.567,89 €
Indian grouping, rupee
₹12,34,567.89
Japanese, yen
¥1,234,567
Arabic-Indic digits
١٬٢٣٤٬٥٦٧
Devanagari digits
१२,३४,५६७
Compact, French
1,2 million
Egyptian pound, right to left
‏١٬٢٣٤٬٥٦٧٫٨٩ ج.م.‏
Shekel, right to left
‏1,234.50 ‏₪

Counts up when it comes into view

It starts from `from` (0 by default) and rolls the first time it is on screen. Pass from={value} to skip that.

2.4M+

developers ship with glass every month

Props

PropTypeDefaultDescription
value (required)numberNoneThe number to show.
fromnumber0Where the first roll starts from. Set it to value to skip the intro roll.
localesIntl.LocalesArgumentthe browser'sSets the BCP 47 locale(s) for Intl.NumberFormat.
formatIntl.NumberFormatOptions{}Intl.NumberFormat options, e.g. { style: "currency", currency: "EUR" }.
prefixstringNoneText before the number (read by screen readers too).
suffixstringNoneText after the number (read by screen readers too).
animateOnViewbooleantrueWait until the ticker is on screen before the first roll.
delaynumber0Sets the number of seconds before the first roll.
durationnumber0.6Seconds a roll takes, capped at 0.9 (longer values are clamped so digits are never unreadable for long).
trend"auto" | "up" | "down""auto"Which way digits roll: with the change ("auto", default), or always up / down.
live"off" | "assertive" | "polite""polite"How screen readers hear later changes: "polite" (default), "assertive", or "off" for numbers that change constantly.

Keyboard

KeysAction
TabNot focusable: this is text.

Accessibility

  • The digit wheels are aria-hidden; the final value is in a visually hidden live region (live="polite" by default), so it is read once, correctly formatted, not digit by digit.
  • Under reduced motion the value appears at once.

When to use the number ticker effect

  • Use it for the headline figure of a KPI tile or a totals row that is recalculated when someone picks another date range or filter, so the change reads as motion instead of a jump.
  • Use it for a price or revenue figure with currency formatting, such as 48,250 dollars with no decimals, or a stat row on a landing page that counts up when it scrolls into view.
  • Use prefix and suffix for units like a plus sign or a percent, and locales with format for compact numbers or other numbering systems; right-to-left locales are laid out correctly.
  • Skip it when the number is static or updates many times a second; plain text is better, and live="off" or a non-animated figure suits values that change constantly and would spam screen readers.
  • Pair it with GlassCard for a stat tile, Sparkline for the trend beside it, and SegmentedControl so switching the period makes the digits roll to the new values.

Frequently asked questions

19 effects pages in all: browse them on All effects.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .