Component for annotated-text
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.
Code
import { AnnotatedText } from "@/components/ui/annotated-text"
function Demo() {
return (
<>
<div className="grid grid-cols-2 items-center justify-items-center gap-x-8 gap-y-7 text-base sm:gap-x-16 sm:gap-y-12 sm:text-xl">
<AnnotatedText variant="wavy" delay={0.0}>wavy</AnnotatedText>
<AnnotatedText variant="underline" delay={0.08}>underline</AnnotatedText>
<AnnotatedText variant="doubleUnderline" delay={0.16}>doubleUnderline</AnnotatedText>
<AnnotatedText variant="dottedUnderline" delay={0.24}>dottedUnderline</AnnotatedText>
<AnnotatedText variant="line" delay={0.32}>line</AnnotatedText>
<AnnotatedText variant="arrow" delay={0.4}>arrow</AnnotatedText>
<AnnotatedText variant="highlight" delay={0.48}>highlight</AnnotatedText>
<AnnotatedText variant="circle" delay={0.56}>circle</AnnotatedText>
<AnnotatedText variant="box" delay={0.64}>box</AnnotatedText>
<AnnotatedText variant="bracket" delay={0.72}>bracket</AnnotatedText>
<AnnotatedText variant="strikethrough" delay={0.8}>strikethrough</AnnotatedText>
<AnnotatedText variant="crossOut" delay={0.88}>crossOut</AnnotatedText>
</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" }}>
<Demo />
</div>
);
}
































