01.16 · Scroll-Based

Counter Animation

Numbers count up when they scroll into view. Best for stats.

Scroll it

Scroll inside the box, or press Play and it scrolls for you.

Scroll down ↓

active users
uptime
revenue
experience

Try it

Change a setting, then scroll again or press Play.

Starts counting

How far the numbers scroll into the box before counting.

Speed

How long the numbers take to reach their totals.

Feel

Springy goes a little past each total, then settles.

More optionsFewer options

Each number starts a moment after the one before.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a count-up animation to [the numbers in your stats section]. When the numbers scroll far enough into view, count each one up from zero to its total, and format it on every step so commas, currency signs and units show the whole way through, not just at the end. Count again if the numbers leave the view and come back. When the settings include it, start each number a moment after the one before for a cascade. Screen readers should hear each final number once, never the steps in between. If the visitor has reduced motion turned on, show the final numbers straight away. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Stats
  • Annual reports
  • Landing pages
  • Dashboards

Avoid on

  • Prices
  • Data tables