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 nextAdd 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.
Use the CLI
Add components
npx shadcn@latest add @keyframery/tabsThe 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
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 initAdd components
npx shadcn@latest add @keyframery/tabsThe 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. WithcacheComponentsturned on, render them inside<Suspense>afterawait connection(). See the fix.- Motion style.
<KeyframeryProvider motion="calm">inapp/layout.tsxsets it for the whole app, or putdata-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.
Installation
Add Keyframery's animated components for Vercel's UI SDK with the shadcn CLI: guides for Next.js, Vite, TanStack Start, React Router, Astro, Laravel and manual.
Vite
Add Keyframery's animated UI SDK components to a Vite and React project with the shadcn CLI: a new project, a preset from Keyframery Create, or an existing app.