Skip to content
Pixelbits
Docs / Number ticker
Signature

Number ticker

A number whose digits roll like a counter, in pixel steps. Each digit is a CSS-transformed column (no JavaScript animation); screen readers read the formatted value once. Reduced motion shows the value without rolling.

12,840

Installation

npm: import
import { NumberTicker } from "pixelbits/number-ticker";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/number-ticker.json

API

<NumberTicker>

A number whose digits roll like a counter, in pixel steps. Each digit is a CSS-transformed column (no JavaScript animation); screen readers read the formatted value once. Reduced motion shows the value without rolling.

Example
<NumberTicker value={128000} format={{ notation: "compact" }} className="text-6xl font-light" />
PropTypeDefaultDescription
value*number—

The number to show. Changing it rolls the digits to the new value.

formatIntl.NumberFormatOptions—

Intl.NumberFormat options, e.g. { notation: "compact" } for "12.8K" or { style: "currency", currency: "EUR" }.

localestringthe browser's locale

Locale for formatting.

fromZerobooleantrue

Roll in from zero when it first scrolls into view.

Also accepts every prop of Omit<HTMLAttributes<HTMLSpanElement>, "children">.