Keyframery

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-router

Add 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.

Add components

npx shadcn@latest add @keyframery/tabs

Then use it in a route.

Use the CLI

Create the project

npx shadcn@latest init -t react-router

For a project inside a monorepo, add --monorepo.

Add components

npx shadcn@latest add @keyframery/tabs

The files land in app/components/keyframery/, and the motion tokens go into app/app.css.

Use it

app/routes/home.tsx
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 init

Add components

npx shadcn@latest add @keyframery/tabs

Notes for React Router

  • Imports. Keyframery's files are written with @/. The CLI rewrites them to ~/ as it installs, so react-router typegen && tsc passes 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> in app/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.

On this page