Skip to content
IndexRequest a UIAboutContact

Number Count Up

Key figures count up from zero with easing when they come into view, and can be replayed.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Create three metric cards in a row (stacking under 360px): "Patterns" 500+, "Uptime" 99.9% and "Revenue" $4.2M, each with a 26px semibold tabular number and a 12px label. The real final value is written in the markup as text. When a card enters the viewport (IntersectionObserver, threshold 0.4) run a requestAnimationFrame count from 0 to the target over 1200ms with an ease-out cubic curve (1 - (1-t)^3), preserving the prefix, suffix and decimal places of each figure and formatting thousands with toLocaleString. Mark the numbers aria-hidden while counting and expose the final text through a visually hidden span so assistive technology never reads intermediate values. A Replay button re-runs the animation. Under prefers-reduced-motion show the final values immediately and hide nothing.

About this pattern

Definition

Headline numbers animate from 0 to their final value over about a second, with deceleration, so the eye follows the growth and lands on the final figure.

Purpose & UX principles

  • Draws attention to key figures and conveys scale.
  • The final value is in the markup from the start (and is what assistive technology reads), so the animation never hides data.
  • Runs once when the figure becomes visible; a Replay button allows seeing it again.

Interaction states

  • Before (not yet visible), counting, final, replay.

Motion specification

  • 1200ms with an ease-out cubic curve, computed per frame; decimals and prefixes keep their format throughout.
  • Reduced motion: the final figures are shown immediately.

Responsive behaviour

  • Figures use tabular numerals so the width does not jitter while counting.
  • Cards stack on narrow widths.

Code

HTML
<div class="box">
  <div class="kp" id="kp">
    <div class="k"><b data-to="500" data-suf="+">500+</b><small>Patterns</small></div>
    <div class="k"><b data-to="99.9" data-dec="1" data-suf="%">99.9%</b><small>Uptime</small></div>
    <div class="k"><b data-to="4.2" data-dec="1" data-pre="$" data-suf="M">$4.2M</b><small>Revenue</small></div>
  </div>
  <button id="re" type="button">Replay</button>
</div>

Related patterns

Rolling Counter

↗
Rolling CounterMicro Interactions

Sparkline Trend Rows

↗
Sparkline Trend RowsData Visualization

Progress Indicator

↗
Progress IndicatorLoading & Progress