Getting started
Your first component in four steps
Frictionborn components arrive through the shadcn CLI as source code. They live in your project under components/ui, build with your app, and are yours to read and change.
Point shadcn at the registry
Add the
@frictionbornnamespace tocomponents.json, so the shadcn CLI knows where to fetch the components:{ "registries": { "@frictionborn": "https://frictionborn.com/r/{name}.json" } }Add a component
One command copies the component into your project and installs what it needs,
@frictionborn/runtimeincluded. The commands pinshadcn@4.21.1, the version our install tests run against.pnpm dlx shadcn@4.21.1 add @frictionborn/ambient-heroTurn on the reveal gate
Components that reveal on entry (
TextReveal,ScrollReveal,AmbientHeroand others) hide their content only once the page says motion is ready, so the server HTML is always complete and nothing flashes.Next.js (App Router)
Render
<MotionReadyScript />in the<head>ofapp/layout.tsx. It is a small Server Component that setsdata-motion="ok"when hydration starts.import { MotionReadyScript } from "@frictionborn/runtime"; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <head> <MotionReadyScript /> </head> <body>{children}</body> </html> ); }Vite and single-page apps
Call
initMotionReady()once in your entry file, before React mounts:import { createRoot } from "react-dom/client"; import { initMotionReady } from "@frictionborn/runtime"; import App from "./App"; initMotionReady(); createRoot(document.getElementById("root")!).render(<App />);Use your design tokens
The components read your design tokens:
--background,--foreground,--primary,--borderand--muted-foreground. In WebGL canvases they are resolved to real colours for you, so the motion matches the rest of your site in light and dark.
What next
- Browse the components, each with a live playground and its measured spec sheet.
- Building with an AI coding agent? Set it up in two minutes.
- Read the conventions every component follows (units, pausing, refs).