04.34 · Micro-Interactions
Rolling Numbers
Each digit rolls to its new value, like a mileage counter. Best for prices.
Click it
Click or tap −1, +1 or Random to change the number (Reset brings it back), or press Show me.
Visitors today
2,048
Inside, each digit is a window over a column of 0 to 9: a change slides the column, so the new digit rolls into view. Press −1, +1 or Random, or Show me.
Shifts sideways: each digit takes only its own width, so the number jumps sideways; Equal widths: every digit has the same room, so the number stays in place. Press −1, +1, Random or Show me.
Try it
Change a setting, then try it again or press Show me.
Roll speed
How long a digit takes to roll to its new value.
Direction
Up turns every digit forward like a mileage counter; shortest takes the nearer way round.
Each digit starts a moment after the one to its right.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add rolling numbers to [the number that changes, such as a counter, score or price]. Show each digit in a small window over a column of the digits 0 to 9, and when the value changes, slide each column so its new digit rolls into view, like the wheels of a mileage counter; digits that stay the same do not move, and separators stay still. Give every digit the same width so the number never shifts sideways, and only slide the columns, never resize anything, so it stays smooth. Let screen readers hear the plain number once. If the visitor has reduced motion turned on, swap the digits with a short fade instead of rolling. Match the settings listed below.
Your settings
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 GitHubWhat it is
The full explanation is in README.md.