For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Laravel

Install and configure Frakment for Laravel with Inertia.

Frakment works in any Laravel 12+ project with Inertia + React 19 and Tailwind v4. This guide covers both a new project via the CLI and an existing app.

Prerequisites

  • Laravel 12 or newer
  • Inertia.js with React adapter
  • React 19
  • Vite 5+
  • TypeScript
  • Tailwind CSS v4

Components target React 19 and Tailwind v4. For React 18, some components need forwardRef adjustments. For Tailwind v3, port the tokens from Theming manually.

Use the CLI

Scaffold a new Laravel + React app with Frakment installed.

Create project

laravel new app --react
cd app

Install Tailwind v4

$ npm install tailwindcss@latest @tailwindcss/vite

Register the Vite plugin:

vite.config.ts
import tailwindcss from "@tailwindcss/vite";
import laravel from "laravel-vite-plugin";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
 
export default defineConfig({
  plugins: [
    laravel({
      input: ["resources/css/app.css", "resources/js/app.tsx"],
      refresh: true,
    }),
    react(),
    tailwindcss(),
  ],
});

Add components

$ npx frakment@latest init
npx frakment@latest add bubble

Use it

resources/js/pages/Home.tsx
import { Bubble, BubbleContent } from "@/components/ui/message";
 
export default function Home() {
  return (
    <Bubble>
      <BubbleContent>Hello, Frakment.</BubbleContent>
    </Bubble>
  );
}

Existing Project

Add Frakment to a Laravel + Inertia app you already created.

Install Tailwind v4

$ npm install tailwindcss@latest @tailwindcss/vite

Register the Vite plugin in vite.config.ts.

Run frakment init

$ npx frakment@latest init

Point to resources/css/app.css when prompted. The CLI injects the theme block.

Configure the import alias

In tsconfig.json:

tsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./resources/js/*"]
    }
  }
}

Add a component

$ npx frakment@latest add bubble

Project structure

package.json
Vitevite.config.ts
tsconfig.json
app.css
app.tsx
Home.tsx

Verify

ls resources/js/components/ui/bubble.tsx

Then render it in an Inertia page. If it renders without errors, you are ready.

Troubleshooting

Make sure @tailwindcss/vite is in vite.config.ts and the input array includes your CSS file. Laravel Mix is not used in Laravel 12 — Vite only.

Inertia pages live in resources/js/pages/. Make sure the component imports resolve from @/components/ui/*.

Next