Keyframery

Install Keyframery in Next.js

Add Keyframery's animated UI SDK components to a Next.js App Router project 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 next

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/globals.css. A preset with a font adds it to app/layout.tsx with next/font/google.

Add components

npx shadcn@latest add @keyframery/tabs

Then use it in a page.

Use the CLI

Create the project

npx shadcn@latest init -t next

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

Add components

npx shadcn@latest add @keyframery/tabs

The files land in components/keyframery/ (src/components/keyframery/ if your app uses a src folder), and the motion tokens go into app/globals.css.

Use it

app/page.tsx
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "@/components/keyframery/tabs"

export default function Page() {
  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>
  )
}

The page stays a Server Component. The tabs are client components already, marked "use client" in their files.

Existing Project

Check the setup

You need React 19, Tailwind CSS v4 and a components.json. A project made with create-next-app and Tailwind only needs the shadcn CLI set up:

npx shadcn@latest init

Add components

npx shadcn@latest add @keyframery/tabs

The CLI reads your aliases from components.json, so the files go wherever your components live.

Notes for Next.js

  • Server rendering. The components render on the server and start animating once the page hydrates.
  • cacheComponents. Calendar, Date Picker and Date Input read today's date while they render. With cacheComponents turned on, render them inside <Suspense> after await connection(). See the fix.
  • Motion style. <KeyframeryProvider motion="calm"> in app/layout.tsx sets it for the whole app, or put data-motion="calm" on <html> yourself.

Questions

Do the components work in Server Components?

Import them from a Server Component page like any client component. Every file that holds state already starts with "use client", so the page itself stays on the server.

How does a preset's font load in Next.js?

The CLI adds it with next/font/google in app/layout.tsx and points --font-sans at it, so the font is self-hosted and preloaded.

On this page