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
- framer-motion
Code
import TextAnimation from "@/components/ui/staggerText"
export function StaggerTextDemo() {
return (
<div className="text-xl font-medium">
<TextAnimation divideBy="word" delay={0.2}>
This text animates word by word.
</TextAnimation>
</div>
)
}
import * as __R from "react";
export default function __InfinityFrame() {
__R.useEffect(() => {
// Simulated cursor: a slow figure-eight, so pointer-driven effects draw something.
let t = 0;
const id = setInterval(() => {
t += 0.05;
const x = innerWidth * (0.5 + 0.32 * Math.sin(t));
const y = innerHeight * (0.5 + 0.22 * Math.sin(2 * t));
const el = document.elementFromPoint(x, y);
if (!el) return;
const init = { clientX: x, clientY: y, pageX: x, pageY: y, bubbles: true, cancelable: true, view: window };
el.dispatchEvent(new PointerEvent("pointermove", { ...init, pointerType: "mouse", isPrimary: true }));
el.dispatchEvent(new MouseEvent("mousemove", init));
}, 30);
return () => clearInterval(id);
}, []);
return (
<div style={{ position: "relative", width: "100vw", height: "100vh", display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden" }}>
<StaggerTextDemo />
</div>
);
}






























