Installation
npx shadcn@latest add @iconiq/rolling-digitsProps
RollingDigits
17 props
Inline animated counter that swaps digits with spring-driven blur, scale, and vertical motion while exiting the previous character.
value
numberRequired
Target number to display. The component rounds to the nearest integer before formatting.
pad
numberMinimum digit width passed to `String.padStart`. Useful for clock-style or fixed-width counters.
animationDelay
numberDefault
80Milliseconds between queued value steps when `value` changes faster than the animation can finish.
startOnView
booleanDefault
trueWhen true, playback waits until the component enters the viewport once before animating from zero.
locale
booleanWhen true, formats the rounded value with `toLocaleString()` before splitting digits.
format
(value: number) => stringCustom formatter that runs before padding. Overrides `locale` when both are provided.
gap
numberDefault
2Pixel gap between rendered characters in the digit row.
direction
"dynamic" | "up" | "down"Default
dynamicControls whether incoming digits slide up or down. `dynamic` compares the previous and next digit values.
enterStiffness
numberDefault
170Spring stiffness for incoming digit motion.
enterDamping
numberDefault
10Spring damping for incoming digit motion.
exitStiffness
numberDefault
170Spring stiffness for outgoing digit motion.
exitDamping
numberDefault
15Spring damping for outgoing digit motion.
enterY
numberDefault
32Vertical offset in pixels used when a digit enters.
enterBlur
numberDefault
52Peak blur in pixels applied when a digit enters.
enterScale
numberDefault
0.7Starting scale applied when a digit enters.
className
stringMerged onto the outer inline-flex span that wraps the readable and visual layers.
digitClassName
stringMerged onto each animated digit cell wrapper for per-digit styling.
Notes
Non-digit characters from locale separators or custom formatters render as static spans and do not animate.
The visual layer is `aria-hidden`; screen readers receive the formatted number through an `sr-only` span.
When `startOnView` is enabled, the ticker displays zero until the container crosses the viewport threshold (`once: true`, `amount: 0.6`).
Each digit keeps a short exit queue so the previous character can blur and slide out while the next one springs into place.
Layer symbols such as `%` or `$` beside the component in your layout, or include them through `format`.