Install Keyframery in 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.
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 astroAdd 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 src/styles/global.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 astroThe template adds Astro's React integration and Tailwind CSS v4. For a project inside a monorepo, add --monorepo.
Add components
npx shadcn@latest add @keyframery/tabsThe files land in src/components/keyframery/, and the motion tokens go into src/styles/global.css.
Use it
Put the parts together in a React component:
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "@/components/keyframery/tabs"
export default function SettingsTabs() {
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>
)
}Then use it in a page with a client directive, so it hydrates:
---
import Layout from "@/layouts/main.astro"
import SettingsTabs from "@/components/settings-tabs"
---
<Layout>
<SettingsTabs client:load />
</Layout>Existing Project
Check the setup
You need Astro's React integration (npx astro add react), Tailwind CSS v4 and the @/* alias in tsconfig.json. shadcn's Astro guide has each step. Then set up the CLI:
npx shadcn@latest initAdd components
npx shadcn@latest add @keyframery/tabsNotes for Astro
- Client directives. Without one, a React component is static HTML: it shows, but nothing opens, slides or responds. Use
client:loadfor what's on screen at once,client:visiblefor what's further down. - One island per widget. A dialog and the button that opens it, or tabs and their panels, belong in the same
.tsxfile and the same island. - Motion style and speed. Put
data-motion="calm"on<html>in your layout, so the style is there before any island hydrates. Aspeedset onKeyframeryProvideronly reaches the components in its own island.
Questions
Why don't my components animate in Astro?
Astro renders React components to static HTML unless you add a client directive. Add client:load (or client:visible) where you use them, so they hydrate and respond.
Can I write `<Tabs>` and `<TabsTab>` straight into an .astro file?
Not as one interactive component. Each island hydrates on its own and children passed from Astro arrive as static HTML, so the parts can't share state. Put them together in a .tsx file and use that one component in your page.
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.
Manual
Add Keyframery's animated UI SDK components to any React 19 and Tailwind CSS v4 app without the shadcn CLI: dependencies, motion tokens, helpers and files.