Skip to content

No.230 · Stats

Metric Morph

A live metric where only the place values that changed move. Unchanged digits hold still, changed digits turn over in the direction of the change and briefly carry its colour, and a rule under the changed range shows how far up the number the change reached.

The prompt

The design brief behind this component — reuse it to regenerate, remix, or explain it.

Build a live KPI whose transition explains the change instead of counting up. The formatted value (Intl: number, percent or currency, tabular numerals) is split into columns aligned by place value from the right. When a new reading arrives, compare it with the previous string place by place: - Unchanged places do not move at all. - Changed digits turn over vertically: the old digit exits and the new one enters from below when the value rose, from above when it fell (420ms, a 45ms stagger from the largest changed place down). They take the trend colour — green for good, red for bad, with invert for metrics like latency — and ease back to ink after about 1.6s. - A 2px rule in the trend colour draws under the whole changed range, from the leftmost changed digit to the end, and stays until the next reading. Its length is the order of magnitude of the change: a rule under the last two digits means a small wobble; a rule under the thousands means something happened. - A new leading place opens its width (max-width 0 → 1em); a vanished one folds away. Below the number sits a delta line: an arrow, then '+2,390 · +19.2%', then 'vs 5 min ago'. A neutral reading (bump revision with the same value) moves nothing and says 'No change'. Loading dims the value and shows 'Updating…'; a null value shows a placeholder bar. The demo is a four-up KPI strip (active users, conversion %, revenue in OMR, p95 latency) with Live, Rise, Fall, No change and Refresh controls. Paper and Night themes.

Notes

Interaction
Leave it live, or press Rise, Fall, No change or Refresh.
Motion
Changed digits turn over in 420ms with a 45ms stagger; the trend colour settles over 1.6s; the magnitude rule draws in over 360ms.
Accessibility
The visual digits are aria-hidden and a single text alternative reads the label, value and delta. Colour is never the only signal: the arrow, sign and rule all carry the direction. Reduced motion swaps digits in place and keeps the colour and the rule.
Responsive
The value scales with clamp(2.25rem, 6vw, 3.25rem). The demo strip goes from 4 columns to 2 to 1.

Featured

301 components