Odometer digits that count into view, then mark which digits moved on every change, tinted by trend.
Plays in view · replayPlays in view · replay
Live
number-ticker, lively
Use it for a few key figures that change while people look at them: orders and revenue on a live dashboard, a queue length, a total after an action. One row of numbers per section is enough; a page full of counting numbers turns into noise.
pnpm dlx shadcn@latest add @motionkit/number-tickernpx shadcn@latest add @motionkit/number-tickeryarn dlx shadcn@latest add @motionkit/number-tickerbunx --bun shadcn@latest add @motionkit/number-tickerRequires the @motionkit namespace in components.json. See Installation.
import { NumberTicker } from "@/components/ui/number-ticker"
export function Revenue() {
return (
<NumberTicker
value={48250}
format={{ style: "currency", currency: "EUR", maximumFractionDigits: 0 }}
className="text-5xl font-semibold"
/>
)
}The count starts once, the first time the number scrolls into view. If value changes later
(live data, a filter), it rolls from the number on screen to the new one.
When the count lands, the brand bar underneath squashes against its end and springs back (a
transform, so nothing around it moves). The temperament sizes it: barely with calm, lightly
with lively (the default), a clear bounce with playful.
Every change after the first count is marked: the bar gives up its full fill and draws itself
under the digits that changed only, growing from the units on the roll's own timeline, and those
digits take a tone. Going from 48,210 to 48,350 underlines 350, so the eye lands on the
order of magnitude that moved. After a short hold the digits and the bar return to rest.
trend picks the tone: true marks a rise in success and a fall in destructive, "inverse"
does the opposite for numbers where less is better (latency, open tickets), and false (the
default) keeps the brand color both ways.
<NumberTicker value={openTickets} trend="inverse" announce />Intermediate frames use the same number of decimals as the end state, so 99.98 counts as
12.41, 57.06, ... and never flashes extra digits. Set minimumFractionDigits or
maximumFractionDigits in format to take control.
Prop
Type
Also accepts all props of Omit<ComponentProps<"span">, "children">.
format takes any Intl.NumberFormat options: notation: "compact" counts to 18.4K, style: "percent" to 99.6%. Stagger several tickers with delay and put plain units next to them. The
numbers start each card, so reserveWidth is off and they stay aligned with their labels.
Plays in view · replayPlays in view · replay
number-ticker, lively
announce turns the value into a polite live region that speaks each new value once it lands:
one announcement per change, never mid-roll. Use it for numbers that change on their own.reserveWidth={false}.transform and opacity only and run once per
value change. The mark is measured once per change, never per frame.locale defaults to en-US so the server and the browser format the number identically and
hydration never mismatches. Pass your own locale for localized sites.Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
entering the viewport, a value change
Digits jump straight to the final value with no count or roll; a change is marked at once, held, then fades.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)