Pace UI

Rolling Number

Component

About

An animated digit counter that rolls each digit vertically into place using GSAP, for displaying stats, scores, or live-updating counts.

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

Code

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

Usage.tsx

import { useState } from "react";

import { Button } from "@/components/ui/button";
import RollingNumber from "@/components/ui/gsap-rolling-number";

export default function Demo() {
  const [count, setCount] = useState(48291);

  return (
    <div className="flex flex-col items-center justify-center gap-4 py-6">
      <div className="font-mono text-3xl font-bold tracking-wider sm:text-4xl">
        <RollingNumber targetNumber={count} height={40} />
      </div>
      <Button
        variant="outline"
        size="sm"
        onClick={() => setCount(Math.floor(10000 + Math.random() * 90000))}
      >
        Randomize
      </Button>
    </div>
  );
}

Dependencies

More by Pace UI

View all
  • Dot Loader

    Dot Loader

    960
  • Flip Reveal

    Flip Reveal

    669
  • Dot Flow

    Dot Flow

    267
  • Draw Line Text

    Draw Line Text

    119
  • Liquid Glass

    Liquid Glass

    62
  • Liquid Cursor

    Liquid Cursor

    51
  • Layered Stack

    Layered Stack

    46
  • Calendar Heatmap Chart

    Calendar Heatmap Chart

    10