A rolling hover-animated text component built with Motion One.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- react
- motion
Code
import TextRoll from "@/registry/gammaui/text-roll"
const navigationItems = [
{
name: "Home",
href: "/",
description: "[0]",
},
{
name: "Components",
href: "/components",
description: "[1]",
},
{
name: "Pricing",
href: "/pricing",
description: "[2]",
},
{
name: "How to use",
href: "/docs/quick-start",
description: "[3]",
},
{
name: "Account",
href: "/user",
description: "[4]",
},
{
name: "Login",
href: "/login",
description: "[7]",
},
]
export default function TextRollDemo() {
return (
<ul className="flex min-h-full w-full flex-1 flex-col items-center justify-center gap-1.5 rounded-2xl px-7 py-3 backdrop-blur-sm">
{navigationItems.map((item, index) => (
<li
className="relative flex cursor-pointer flex-col items-center overflow-visible"
key={index}
>
<div className="relative flex items-start">
<TextRoll
center
className="text-4xl leading-[0.8] font-extrabold tracking-[-0.03em] uppercase transition-colors lg:text-5xl"
>
{item.name}
</TextRoll>
</div>
</li>
))}
</ul>
)
}
































