Install Keyframery in SvelteKit
Add Keyframery's animated UI SDK components to a Svelte 5 app with the shadcn-svelte CLI. Use the same parts, motion styles and Agent view as React.
Keyframery for Svelte has every component React has, with the same parts, Tailwind classes, five motion styles and Agent view. The shadcn-svelte CLI copies the files into your project, so you own the code.
Choose where to start.
SvelteKit
Create the project
npx sv create my-app --template minimal --types ts --add tailwindcss='plugins:none'Open the new project folder before running the next commands.
Set up the CLI
npx shadcn-svelte@latest initThis writes components.json, the colour tokens and the cn helper. Keyframery uses the same tokens, so it matches any shadcn-svelte components you add later.
Declare the UI SDK layer before Tailwind in the global CSS file listed in components.json. This lets your utility classes take precedence over UI SDK's runtime styles.
@layer ui-sdk;
@import "tailwindcss";Add components
npx shadcn-svelte@latest add https://keyframery.com/r/svelte/tabs.jsonThe files land in src/lib/components/keyframery/tabs/, one Svelte file per part and an index that exports them. The CLI adds the motion tokens to your global CSS and puts the speed helpers in src/lib/keyframery.ts. Components that build on others bring them along.
Use it
Import the parts
<script lang="ts">
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "#lib/components/keyframery/tabs/index.js"
</script>
<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 current SvelteKit scaffold uses #lib for src/lib. Use $lib in place of #lib if your project uses the $lib alias, and keep the explicit /index.js import.
Props use names like defaultValue and onValueChange. Use bind:value on parts with a bindable value. Content that depends on a part's state uses a Svelte snippet, such as {#snippet children(state)}.
Pick how it moves
Subtle is the default. To change it for the app, wrap your pages in KeyframeryProvider:
<script lang="ts">
import { KeyframeryProvider } from "#lib/keyframery.js"
let { children } = $props()
</script>
<KeyframeryProvider motion="springy">
{@render children()}
</KeyframeryProvider>Keep your layout's global CSS import. For the chosen style on the first server-rendered paint, set data-motion="springy" on the existing <html> in src/app.html. Any component with a speed prop also accepts "fast", "slow" or a number. See the five styles.
Install everything
npx shadcn-svelte@latest add https://keyframery.com/r/svelte/all.jsonNotes for Svelte
- Same code as the docs. Pick Svelte in the install card or a code tab. The docs remember your choice.
- Option labels. Pass matching
itemsdata to Select and Combobox when an initial value needs a label before the popup opens. Keep the styled item parts. For an example withstate.items, see Command. - Changing labels. Use the same string for a Badge's
textprop and its child content when a changing label should pulse:<Badge dot text={label}>{label}</Badge>. - Accordion copy. Wrap plain text in a paragraph, as in
<AccordionPanel><p>Changes are free on this fare.</p></AccordionPanel>. - Markdown. Pass source to Markdown with
content={markdown}and to ReasoningContent withtext={markdown}. Use a snippet for custom reasoning content. - Typed parts and server rendering. The parts use UI SDK's props and render in SvelteKit. Known differences and workarounds.
Questions
Are the Svelte components the same as the React ones?
The Svelte components have the same parts, Tailwind classes, five motion styles and Agent view. The Svelte examples use snippets and Svelte's prop conventions.
Does Keyframery work with SvelteKit server rendering?
Yes. The components render on the server and hydrate in the browser. Put your motion style on the html element in src/app.html to apply it on the first paint.
Do I need to add other shadcn-svelte components?
The CLI copies the Keyframery files and configures your CSS. Keyframery builds on UI SDK for Svelte, and its files sit next to any shadcn-svelte components you already have.
Vue
Add Keyframery's animated UI SDK components to a Vue 3 or Nuxt project with the shadcn-vue CLI. Same components, parts, motion styles and Agent view as React.
Swap the import
Every Keyframery primitive has the same parts and props as its UI SDK component. Change one import line and the component animates. Your markup and styles stay.