Skip to content

Rolling digit counter

Digits that spin on their rollers like a mechanical counter before stopping on the right value, in pure CSS.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Each digit is a small window behind which a 0 to 9 strip slides to the right value, with a slight delay from one digit to the next: the odometer effect, ideal to present the key figures of a charity, a company or a fundraiser. No script counts anything: each strip’s position comes from the --efcr-digit variable and only the transform is animated, once on load. The real number is present as text for screen readers and search engines, the rollers being hidden; the description list pairs each figure with its label. Tabular digits, AA contrast in light and dark mode, a grid that drops to one column at 360 px with no horizontal scrolling. With prefers-reduced-motion the digits show their value straight away.

Code

Loading the code…

The code of this component in

Archive contents

effet-compteur-rouleaux-html-tailwind.zip3 files · 4 Ko

  • index.html7 Ko
  • README.md3 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component