A ui component.
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
- motion
Code
"use client"
import { useState } from "react"
import Letter3DSwap from "@/components/fancy/text/letter-3d-swap"
export default function Preview() {
const [debug, setDebug] = useState(false)
return (
<div className="relative w-dvw h-dvh flex flex-col items-center justify-center p-8 bg-background">
{/* <button
className="absolute top-4 left-4 px-2 py-1 bg-background text-foreground rounded-md border text-[8px] cursor-pointer hover:bg-muted"
onClick={() => setDebug(!debug)}
>
Debug: {debug ? "On" : "Off"}
</button> */}
<div className="flex flex-col items-center max-w-2xl font-cotham">
<Letter3DSwap
mainClassName="text-2xl sm:text-5xl md:text-7xl bg-background lowercase"
frontFaceClassName={`bg-background ${debug ? 'border' : ''} text-foreground`}
secondFaceClassName={`bg-background ${debug ? 'border' : ''} text-foreground`}
rotateDirection="top"
staggerDuration={0.03}
staggerFrom="first"
transition={{ type: "spring", damping: 25, stiffness: debug ? 50 : 160 }}
>
SET YOUR MIND TO IT
</Letter3DSwap>
</div>
</div>
)
}




























