pnpm dlx shadcn@latest add @gammaui/text-roll
import { TextRoll } from "@/components/ui/text-roll"
export default function Example() {
return <TextRoll className="text-4xl font-semibold">Gamma UI</TextRoll>
}This will create a letter-by-letter animated roll effect when hovering.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | The text that will animate letter by letter. |
| className | string | — | Extra Tailwind classes applied to the wrapper. |
| center | boolean | false | If true, animation timing staggers from the center instead of left-to-right |
motion/react)import { TextRoll } from "@/components/ui/text-roll"
export default function Example() {
return (
<TextRoll center className="text-5xl font-bold">
Gamma UI
</TextRoll>
)
}export default function HeroSection() {
return (
<h1 className="text-6xl leading-tight font-extrabold">
<TextRoll className="text-indigo-500">Build Fast</TextRoll>
<br />
<TextRoll center className="text-gray-800">
Ship Beautiful
</TextRoll>
</h1>
)
}