4 JavaScript Counters

This collection is a complete guide to creating counters with JavaScript, from basic interactivity to complex visual effects. It starts with the fundamentals: managing a value via addEventListener and updating the DOM. Next, the popular “count-up” technique is demonstrated - a smooth animation of a number to its target value, triggered on scroll. To create more impressive interfaces, examples that mimic a mechanical odometer via transform are featured, adding tactility and visual interest.

Last updated:

thumbnail: Incrementing Counter

Incrementing Counter

A dynamic and engaging statistics block that creates a sense of activity and popularity through running numbers and background animation.

thumbnail: Motion Blurred Number Counter

Motion Blurred Number Counter

As the slider moves, the numbers change rapidly, blurring horizontally to create a sensation of high-speed motion (motion blur), reminiscent of an old speedometer or a slot machine counter.

thumbnail: Soft UI Counter Component

Soft UI Counter Component

This simple counter demonstrates clean vanilla JavaScript functionality: counter management, class switching for instant color scheme change based on the number’s sign. The stylistic focus is on “Soft UI” aesthetics.

thumbnail: Bouncy Counter

Bouncy Counter

A technical approach to dynamic UI effects: the counter digits are animated via custom CSS transitions, while the high-contrast “shade” effect during the change is achieved using the contemporary mix-blend-mode: difference property.