Installation
Yan installs through the shadcn CLI. Any project the CLI supports works: Next.js, Vite, React Router, Astro and more.
1. Set up shadcn
If your project doesn't have a components.json yet, initialize it first:
npx shadcn@latest init2. Add a component
Point the CLI at Yan's registry. Here's Button:
❯ npx shadcn@latest add https://yan.moe/r/button.jsonThe CLI also pulls in what the component needs:
yan-theme: the pastel tokens, candy surface utilities and keyframes, merged into your global CSS.yan-fx: the effects layer, written tolib/yan-fx.ts.radix-uiandclass-variance-authorityfrom npm.
3. (Optional) A rounded font
Yan looks best with a rounded face. Onomatopoeia stickers use --yan-font-fx,
which falls back to M PLUS Rounded 1c and then the system font. With Next.js:
import { M_PLUS_Rounded_1c } from "next/font/google"
const rounded = M_PLUS_Rounded_1c({
variable: "--font-rounded",
weight: ["400", "700", "900"],
subsets: ["latin"],
}):root {
--yan-font-fx: var(--font-rounded);
}Use it
import { Button } from "@/components/ui/button"
export function Hello() {
return <Button sfx="やった!">Save</Button>
}