Number Ticker
Counts to a number when it scrolls into view, with locale-aware formatting and a screen-reader friendly final value.
12,480
Example metric (placeholder)
When to use
Use it to draw attention to a few key figures: metrics on a landing page, totals in a dashboard header, results after an action. One row of numbers per section is enough; a page full of counting numbers turns into noise.
Playground
Installation
pnpm dlx shadcn@latest add @cadence/number-tickerRequires the @cadence namespace in components.json. See Installation.
Usage
import { NumberTicker } from "@/components/ui/number-ticker"
export function Revenue() {
return (
<NumberTicker
value={48250}
format={{ style: "currency", currency: "EUR", maximumFractionDigits: 0 }}
className="text-5xl font-semibold"
/>
)
}The count starts once, the first time the number scrolls into view.
Props
Prop
Type
Also accepts all props of Omit<ComponentProps<"span">, "children">.
Examples
Stats row
Stagger several tickers with delay and add units around them.
- Uptime
- 99.98%
- Revenue
- $48,250
- Latency
- 42 ms
Accessibility
- Screen readers always hear the final, formatted value. The animated digits are hidden from the accessibility tree, so nobody hears dozens of intermediate numbers.
- With reduced motion the final value appears immediately.
- Digits use tabular figures so the number does not jitter in width while it counts.
Performance
- Digits are written straight to the DOM on each frame; React does not re-render during the count.
localedefaults toen-USso the server and the browser format the number identically and hydration never mismatches. Pass your own locale for localized sites.