Install Keyframery in React Router
Add Keyframery's animated UI SDK components to a React Router framework-mode app with the shadcn CLI: a new project, a Create preset, or an existing app.
Choose the setup that matches your starting point.
Use Keyframery Create
Build your preset
Open Keyframery Create and pick your colours, corners, font and motion. Copy the command under the preview.
Create the project
npx shadcn@latest init -t react-routerAdd the preset
Run the command you copied from the project's folder:
npx shadcn@latest add @keyframery/preset-<code>It writes the colours, corners and motion into app/app.css. A preset with a font installs it from Fontsource and imports it there too.
Use the CLI
Create the project
npx shadcn@latest init -t react-routerFor a project inside a monorepo, add --monorepo.
Add components
npx shadcn@latest add @keyframery/tabsThe files land in app/components/keyframery/, and the motion tokens go into app/app.css.
Use it
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "~/components/keyframery/tabs"
export default function Home() {
return (
<Tabs defaultValue="account">
<TabsList aria-label="Settings">
<TabsTab value="account">Account</TabsTab>
<TabsTab value="password">Password</TabsTab>
</TabsList>
<TabsPanels>
<TabsPanel value="account">Account settings</TabsPanel>
<TabsPanel value="password">Password settings</TabsPanel>
</TabsPanels>
</Tabs>
)
}Existing Project
Check the setup
You need React 19, Tailwind CSS v4 and the ~/* alias pointing at app/. Apps made with create-react-router have both. Then set up the CLI:
npx shadcn@latest initAdd components
npx shadcn@latest add @keyframery/tabsNotes for React Router
- Imports. Keyframery's files are written with
@/. The CLI rewrites them to~/as it installs, soreact-router typegen && tscpasses without edits. - Server rendering. The components render on the server and start animating once the page hydrates.
- Motion style. Put
data-motion="calm"on<html>inapp/root.tsx, or wrap the<Outlet />in<KeyframeryProvider motion="calm">.
Questions
My app uses `~/` instead of `@/`. Do I change the imports?
No. The shadcn CLI reads the ~/ alias from components.json and rewrites every Keyframery import to match while it installs.
Where do the files go?
Into app/components/keyframery/, with the shared motion helpers in app/lib/keyframery.tsx and the motion tokens in app/app.css.
Laravel
Add Keyframery's animated UI SDK components to a Laravel app with the React starter kit and Inertia: a preset from Keyframery Create, or the shadcn CLI.
Astro
Add Keyframery's animated UI SDK components to an Astro site as React islands: install them with the shadcn CLI and hydrate each one with a client directive.