Count Up

An animated number that counts from a starting value to a target when scrolled into view — essential for metrics and stats sections.

UniqueUI CLI

npx uniqueui add count-up

shadcn CLI

npx shadcn@latest add https://uniqueui.com/r/count-up.json -y

shadcn path expects @/lib/utils (run shadcn init first). Same source file is installed to components/ui/.

Preview

0+

GitHub Stars

0.0%

Uptime SLA

0 components

Ready to use

0+

Developers

Usage

"use client";
import { CountUp } from "@/components/ui/count-up";

export default function Stats() {
  return (
    <div className="flex gap-12">
      <div className="text-center">
        <p className="text-5xl font-black text-white">
          <CountUp to={12400} suffix="+" duration={2.5} />
        </p>
        <p className="text-neutral-400 mt-1">Stars on GitHub</p>
      </div>
      <div className="text-center">
        <p className="text-5xl font-black text-white">
          <CountUp to={99.9} decimals={1} suffix="%" duration={2} />
        </p>
        <p className="text-neutral-400 mt-1">Uptime SLA</p>
      </div>
    </div>
  );
}

Props

PropTypeDescription
tonumberTarget (end) value.
fromnumberStarting value.
durationnumberAnimation duration in seconds.
decimalsnumberNumber of decimal places.
prefixstringPrepended string, e.g. "$".
suffixstringAppended string, e.g. "k+".
separatorstringThousands separator. Pass empty string to disable.
oncebooleanOnly animate on first scroll-enter.
classNamestringExtra Tailwind classes.
theme"light" | "dark"Theme context.