Number flow
A number that rolls each digit in its own column, in the direction the value moved, while Intl handles currency, percent and compact formats and the width eases to fit.
npx shadcn@latest add @uimaxxer/number-flowPasskeysSettings · Usage
Usage
Agent spend in November
$960.34
- Day
- Mon 23 Nov
- Tokens
- 14.2M
- Day on day
- 0.0%
Number flow is a Pro component
The demo and the docs are free. The source comes with Pro, through this page, the shadcn CLI and the MCP.
Usage
import { NumberFlow } from "@/components/ui/number-flow"
const usd = { style: "currency", currency: "USD" } as const
<NumberFlow value={spend} format={usd} />Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| value | number | The number to show. Change it and the digits roll. | |
| format | Intl.NumberFormatOptions | Currency, percent, compact, signDisplay, fraction digits. Pass a stable object. | |
| locales | string | string[] | "en-US" | Fixed by default so the server and the browser format the same way. |
| tone | "none" | "sign" | "trend" | "none" | sign colours gains and losses; trend flashes the direction of a change, then settles to ink. |
| direction | "auto" | "up" | "down" | "auto" | Which way the digits roll. |
Accessibility
- Screen readers get the whole formatted number as text; the rolling columns are hidden from them.
- Reduced motion swaps the roll and the width change for a crossfade.
- Colour is never the only signal: pair tone with signDisplay so a loss also reads as a minus.