Cnippet

Text Roll

Cards 27

About

Characters roll in and out with a 3D perspective flip — each letter animates independently for a mechanical, tactile reveal effect.

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

Code

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

Usage.tsx

"use client";

import { useState } from "react";
import { TextRoll } from "@/components/ui/text-roll";

const metrics = [
  { label: "Components", value: "164+" },
  { label: "Downloads", value: "98K" },
  { label: "Stars", value: "4.2K" },
];

export default function TextRollStats() {
  const [key, setKey] = useState(0);

  return (
    <div className="flex min-h-50 flex-col items-center justify-center gap-8 px-6">
      <div className="grid grid-cols-3 gap-10 text-center">
        {metrics.map((metric, i) => (
          <div key={metric.label}>
            <p className="font-bold text-3xl text-foreground tabular-nums sm:text-4xl">
              <TextRoll
                duration={0.4}
                getEnterDelay={(j) => i * 0.15 + j * 0.04}
                key={key}
              >
                {metric.value}
              </TextRoll>
            </p>
            <p className="mt-1 text-muted-foreground text-sm">{metric.label}</p>
          </div>
        ))}
      </div>
      <button
        className="rounded-md bg-accent px-4 py-1.5 font-medium text-foreground text-sm hover:bg-accent/80"
        onClick={() => setKey((k) => k + 1)}
        type="button"
      >
        Replay
      </button>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    683
  • Aero Hero-3

    Aero Hero-3

    558
  • Features

    Features

    510
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    487
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    465
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    356

More in Cards

View all
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Stats cards with links

    Stats cards with links

    39
  • The Item one

    The Item one

    3
  • Card Studio

    Card Studio

    7
  • Statistics Card 7

    Statistics Card 7

    292
  • Item

    Item

    10