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
Implementation depth
An odometer counter is a fixed-slot transition, not a text-width animation. Each digit column reserves the width of the largest numeral and rolls a transform strip, so changing values do not resize the metric row.
Use tabular numbers and announce the final value once. Screen readers should not hear every intermediate digit in a roll. Reduced motion can snap to the new number while preserving the fixed slots and visible change state.
The pattern should be abstracted away from KPI cards. A KPI may use it, but the slug is about fixed digit columns, carry timing, overflow clipping, and stable metric width.
Watch sign, decimal, and unit changes separately. Digits can roll, but currency symbols, percent signs, separators, and labels should usually remain stable or crossfade without shifting the row.