Cnippet

Counting Number

Cards 196

About

An animated number that smoothly counts from a start value up to a target, with imperative replay and start/complete callbacks.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Counting Number to your project and fits it to your theme.

Code

How Counting Number is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { CountingNumber } from "@/components/ui/counting-number";

const stats = [
  { target: 83, suffix: "+", label: "Components shipped" },
  { target: 2, suffix: "K", label: "GitHub stars" },
  { target: 49, suffix: "K", label: "Monthly downloads" },
  { target: 19, suffix: "", label: "Contributors" },
];

export default function CountingNumberDemo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center bg-background p-8">
      <div className="grid grid-cols-2 gap-x-12 gap-y-10 sm:grid-cols-4">
        {stats.map((stat) => (
          <div key={stat.label} className="text-center">
            <div className="text-3xl font-bold tracking-tight text-foreground sm:text-4xl">
              <CountingNumber target={stat.target} />
              {stat.suffix}
            </div>
            <p className="mt-2 text-sm text-muted-foreground">{stat.label}</p>
          </div>
        ))}
      </div>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    681
  • Aero Hero-3

    Aero Hero-3

    554
  • Features

    Features

    506
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    480
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    463
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    354

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    120
  • Course Design Cards

    Course Design Cards

    1.1K
  • Statistics Card 2

    Statistics Card 2

    259
  • Card

    Card

    56
  • Card Studio

    Card Studio

    9
  • Statistics Card 7

    Statistics Card 7

    289
  • The Item one

    The Item one

    3
  • Weather Card

    Weather Card

    53