Keyframery

Install Keyframery in 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.

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 vite

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 src/index.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 your app.

Use the CLI

Create the project

npx shadcn@latest init -t vite

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

Add components

npx shadcn@latest add @keyframery/tabs

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

Use it

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

export default function App() {
  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 through @tailwindcss/vite, and the @/ alias in tsconfig.json, tsconfig.app.json and vite.config.ts. shadcn's Vite guide walks through each file. Then set up the CLI:

npx shadcn@latest init

Add components

npx shadcn@latest add @keyframery/tabs

Notes for Vite

  • Strict builds. Every Keyframery file passes the template's noUnusedLocals, noUnusedParameters, verbatimModuleSyntax and erasableSyntaxOnly checks, so tsc -b && vite build stays green.
  • "use client". The files start with it for frameworks that render on the server. Vite ignores it.
  • Motion style. Wrap the app in <KeyframeryProvider motion="calm"> in src/main.tsx, or put data-motion="calm" on <html> in index.html.

Questions

Does Vite's default build pass with Keyframery installed?

Yes. The shadcn Vite template builds with tsc -b && vite build and strict unused-variable checks, and every Keyframery file passes them.

How does a preset's font load in Vite?

The CLI installs the font's @fontsource-variable package and imports it at the top of src/index.css, then points --font-sans at it.

On this page