Docs
Fliping Digital Counter

Fliping Digital Counter

Display a fliping digital counter with animations.

Installation

Install the following dependencies:

npm install styled-components

Copy and paste the counter code into your project.

Fliping Counter

A highly realistic, retro-style counter component that simulates the classic mechanical flip-clock display. The animation is achieved entirely through CSS, leveraging staggered animation-delay to create a continuous and seamless counting effect.

Features

  • Pure CSS Animation: High-performance, self-contained animation that does not rely on JavaScript for ticking.
  • Configurable Initial Value: Set any starting number via a value prop.
  • Adjustable Digits: Easily change the number of digits displayed using the digits prop.
  • Seamless Looping: The counter animates and loops indefinitely from its starting point.
  • Automatic Padding: Numbers smaller than the specified digit count are automatically padded with leading zeros.

Usage Example


export default function Demo() {
  return (
    <div className="w-full h-screen">
      <FlipingCounter />
    </div>
  );
}