# M text morph 2

> Auto-cycling plan name — interval advances through strings in a card

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-text-morph-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-morph`

## Files

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

```tsx
"use client";

import { useEffect, useState } from "react";
import { TextMorph } from "@/registry/default/motion/text-morph";

const plans = ["Starter", "Pro", "Enterprise"];

export default function TextMorphPricing() {
  const [index, setIndex] = useState(0);

  useEffect(() => {
    const id = setInterval(() => setIndex((i) => (i + 1) % plans.length), 2200);
    return () => clearInterval(id);
  }, []);

  return (
    <div className="flex min-h-50 items-center justify-center px-6">
      <div className="w-full max-w-xs rounded-xl border border-border bg-card p-6 text-center">
        <p className="mb-1 font-medium text-muted-foreground text-xs uppercase tracking-widest">
          Current plan
        </p>
        <TextMorph
          as="h3"
          className="font-bold text-3xl text-foreground"
          transition={{
            damping: 20,
            mass: 0.25,
            stiffness: 320,
            type: "spring",
          }}
        >
          {plans[index] ?? plans[0] ?? ""}
        </TextMorph>
        <p className="mt-3 text-muted-foreground text-sm">
          Upgrade or downgrade at any time.
        </p>
      </div>
    </div>
  );
}
```
