Ballmac UI home

Animated Number Flow

A number whose digits roll like an odometer to the new value, with locale and Intl formatting for currency, percent and compact notation, and widths that animate as digits come and go.

Starter

$12

per seat / month

Team

$49

per seat / month

Scale

$199

per seat / month

Installation

$ pnpm dlx shadcn@latest add @ballmac/animated-number-flow

Usage

import { AnimatedNumberFlow } from "@/components/ballmac/animated-number-flow"

The full example is in the Code tab above.

Examples

Currency, percent, compact

Revenue
$16,056
Growth
12.8%
Users
102.8K
Latency
64.2ms

API reference

PropTypeDefault
value*

The number to show. Change it and the digits roll to the new value.

number—
locale

BCP 47 locale for grouping and decimals. Fixed by default so the server and browser agree.

string—
format

Intl.NumberFormat options: currency, percent, compact, fraction digits and so on.

Intl.NumberFormatOptions—
prefix

Text before the number, such as a unit label.

string—
suffix

Text after the number.

string—
announce

Read each change aloud politely. Off by default because values that change often are noisy.

booleanfalse
fade

Fade the top and bottom edge of each rolling digit.

booleantrue

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersThe formatted number is read as text; announce adds a polite live region
Reduced motionThe value changes instantly

Use with AI

<AnimatedNumberFlow value format locale prefix suffix announce fade />. Change value and each digit rolls to its new place. Uses Intl.NumberFormat with a fixed default locale so server and browser agree. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Animated Number Flow (@ballmac/animated-number-flow) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Prices, balances and stats that change on interaction
  • Live metrics

Not for

  • A one-time count-up on scroll (number-ticker)

Registry JSON: https://ui.ballmac.com/r/animated-number-flow.json

Credits

Free to use in personal and commercial projects.