Overview
An odometer counter rolls digits inside fixed slots. The animation is useful because it preserves metric width while making the value change perceptible. The reusable pattern is not a KPI card; it is the fixed-slot digit transition that prevents nearby labels, icons, or cards from shifting.
When to use it
Use it for KPIs, counters, balances, score changes, and short metrics where the number is the subject and the update deserves attention. It works best when values change occasionally and the user benefits from seeing direction. Do not use it for long tables, rapidly updating telemetry, or logs where users need immediate legibility over motion.
How it works
Each digit column is an overflow: hidden slot. A vertical strip of digits moves with translateY, font-variant-numeric: tabular-nums keeps widths consistent, and the wrapper reserves the total metric footprint.
Production gotchas
Never animate the text node width directly. That causes neighboring labels or cards to move, and the effect becomes more obvious when the new value has more digits. Also avoid announcing every intermediate digit; assistive tech should receive the final committed value, not the decorative roll.
Accessibility
Use aria-live politely for the committed value and hide decorative rolling strips if a separate accessible number is present. Reduced motion should snap to the final value while keeping the fixed slots and visible changed state. Do not make color or motion the only sign that a number increased or decreased.
References