Number Animation
Two ways a quantity changes. NumberTicker rolls each digit position like a geared odometer; AnimatedNumber interpolates one value into the next. Both keep the settled number in the accessible tree as plain text and mark the moving glyphs aria-hidden, so assistive tech is never handed a stack of ten digits or a hundred intermediate readings.
import { NumberTicker, AnimatedNumber } from "@pestoui/core"Rolling ticker
Every digit position is a window one glyph tall clipping a column of all ten, and the column translates to bring the right one into frame. The stagger counts from the right, so the ones column leaves first and the leading digit lands last — the order a geared odometer actually moves in. Step 99 then 100 for the case worth watching: columns are keyed by PLACE VALUE, never by array index, so the ones and tens roll from 9 to 0 while a brand-new hundreds column mounts already showing its 1 and never animates at all. Keyed by index, gaining a digit would shift every position by one and re-roll the whole number — a value that flickers wholesale each time it crosses a boundary.
Currency and decimals
Sign, prefix, group separators and suffix are static cells sitting between the rolling columns, so only the digits that changed ever move. Decimal places are fixed rather than derived from the value: a width that varied with the number would re-key every column on each update and re-roll digits that had not changed. Add and remove seats to watch the cents roll while the leading digits hold.
Count-up
One value interpolated into the next on a frame loop, eased out over a fixed duration rather than driven by a spring — and that is a correctness constraint, not a taste call. Every spring in the system bar the overdamped pair crosses its target before settling, and a counter that crosses its target briefly displays a number that was never true. Overshoot is free on a knob and simply wrong on a quantity, so this one approaches from a single side and lands on the exact target instead of on the last sampled frame. Randomise mid-count to see the re-aim: the next run starts from the frame actually on screen, not from zero.
Props
Pesto UI · 117 documented components