Skip to content
Browse docs and components

Number Ticker

number-ticker

A number that counts up when it scrolls into view and counts between values when it changes, formatted with Intl. Screen readers hear the final value once, and reduced motion skips the count.

Responsive

Install

$npxshadcnadd@forme/number-ticker

Adds the component, its registry dependencies, and the token stylesheet you import once.

Usage

import { NumberTicker } from "@/components/forme/number-ticker/number-ticker";

<NumberTicker value={12480} format={{ notation: "compact" }} />

When to use

Reach for it

  • A headline figure that should draw the eye once, like a stat on a landing page or a KPI that just updated.

Use something else

  • Tables and dense dashboards, where a dozen counting numbers would compete with each other.
  • Values that change every second; use NumberFlow, which only rolls the digits that changed.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

NumberTicker

A number that counts to its value the first time it scrolls into view, and from its old value to its new one on every change after that.

PropTypeDefaultDescription
value*number—
fromnumber0Where the first count starts. Later changes count from the previous value.
durationnumber1200Milliseconds. Long enough to be read as counting, short enough not to wait for.
formatIntl.NumberFormatOptions—
localeIntl.LocalesArgument"en-US"

Also takes every prop of <span> attributes.

Accessibility

  • The counting digits are aria-hidden and the final value is rendered once for screen readers, so nobody hears thirty intermediate numbers.

Motion

  • It counts the first time it scrolls into view, and from the old value to the new one on every change after that.
  • Plain requestAnimationFrame over duration, 1200ms by default; reduced motion skips straight to the value.