# M text roll 2

> Stats row — three TextRoll instances with offset delays animate key metrics with replay

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-text-roll-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-text-roll-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-text-roll-2-light-f3525d8610f17daa.png
- Registry item: https://ui.cnippet.dev/r/m-text-roll-2.json
- Categories: text roll
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-text-roll-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/text-roll`

## Files

### `registry/default/motion-variants/m-text-roll-2.tsx`

```tsx
"use client";

import { useState } from "react";
import { TextRoll } from "@/registry/default/motion/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>
  );
}
```
