Keyframery

Install Keyframery in Laravel

Add Keyframery's animated UI SDK components to a Laravel app with the React starter kit and Inertia: a preset from Keyframery Create, or the shadcn CLI.

The shadcn CLI doesn't scaffold a Laravel app. Create one with the React starter kit first, then add Keyframery.

Create the project

laravel new my-app

Choose the React starter kit when asked. It sets up Inertia, Tailwind CSS v4 and a components.json. If you already have a Laravel app with React and Inertia, skip this step.

cd my-app

Use Keyframery Create

Build your preset

Open Keyframery Create and pick your colours, corners, font and motion. Copy the command under the preview.

Add the preset

Run the command you copied from the app's folder:

npx shadcn@latest add @keyframery/preset-<code>

It writes the colours, corners and motion into resources/css/app.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 a page.

Use the CLI

Add components

npx shadcn@latest add @keyframery/tabs

The files land in resources/js/components/keyframery/, and the motion tokens go into resources/css/app.css.

Use it

resources/js/pages/welcome.tsx
import { Head } from "@inertiajs/react"

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

export default function Welcome() {
  return (
    <>
      <Head title="Settings" />
      <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>
    </>
  )
}

Run it

composer run dev

Notes for Laravel

  • Where files go. The CLI follows the starter kit's components.json, so components land next to its own in resources/js/components/, and @/ resolves to resources/js/.
  • Reformatting. The starter kit's setup can reformat every file under resources/js/ when Composer updates. Keyframery's files keep type-checking after that.
  • Motion style. Wrap the Inertia app in <KeyframeryProvider motion="calm"> in resources/js/app.tsx, or put data-motion="calm" on <html> in resources/views/app.blade.php.

Questions

Does Keyframery work with Laravel's React starter kit?

Yes. The starter kit already has Tailwind CSS v4, the @/ alias and a components.json, so the shadcn CLI installs Keyframery into resources/js/components/keyframery/ with nothing else to set up.

Do I need PHP to install the components?

No. The shadcn CLI runs with Node. You need PHP to run the app, as any Laravel app does.

On this page