Render images as responsive ASCII artwork with image, flow, and glitch variations.
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
"use client";
import { AsciiEffect } from "@/components/ui/ascii-effect";
import type { ReactNode } from "react";
const imageSrc = "https://componentry.dev/images/ascii-effects/chrome-bust.webp";
function PreviewFrame({
children,
}: {
children: ReactNode;
}) {
return (
<div className="relative size-full min-h-[420px] overflow-hidden bg-black">
{children}
</div>
);
}
export function AsciiImagePreview() {
return (
<PreviewFrame>
<AsciiEffect variant="image" imageSrc={imageSrc} fontSize={6} scale={1} />
</PreviewFrame>
);
}
export function AsciiFlowPreview() {
return (
<PreviewFrame>
<AsciiEffect
variant="flow"
imageSrc={imageSrc}
fontSize={6}
scale={1}
flowSpeed={0.22}
flowStrength={12}
mouseRadius={150}
mouseStrength={22}
/>
</PreviewFrame>
);
}
export function AsciiGlitchPreview() {
return (
<PreviewFrame>
<AsciiEffect
variant="glitch"
imageSrc={imageSrc}
fontSize={6}
scale={1}
glitchIntensity={0.8}
glitchFrequency={1.8}
/>
</PreviewFrame>
);
}
export function AsciiCatalogPreview() {
return (
<AsciiEffect variant="flow" imageSrc={imageSrc} fontSize={4.5} scale={1} />
);
}
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" }}>
<AsciiImagePreview />
</div>
);
}






























