GitHubGitHub
← All components
Motion / component

Number ticker

An animated count-up number that eases between values with tabular figures and Intl formatting.

AnimatingReduced motionCurrency
4,280
<NumberTicker value={metric} format={{ maximumFractionDigits: 1 }} />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { NumberTicker } from '@chanrg/4ui';<NumberTicker value={metric} format={{ maximumFractionDigits: 1 }} />

API reference

Props

PropTypeDefaultDescription
valuenumberrequiredTarget value.
durationnumber900Animation length in milliseconds.
formatIntl.NumberFormatOptionsNumber formatting options.
localestringbrowserFormatting locale.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Announces only the settled value through a polite live region.
  • Renders instantly under reduced motion.

Dependencies

No runtime component dependencies.