Get started
Fabricator UI

Search documentation

Search pages, components, blocks, styles and colours.

Laravel

PreviousNext

Install and configure Fabricator UI for Laravel.

The CLI does not scaffold a new Laravel app. Start by creating a Laravel app with the React starter kit, then choose how you want to configure Fabricator UI.

Create Project

Create a new Laravel app using the Laravel installer:

laravel new my-app

If you already have a Laravel app with React and Inertia configured, skip this step.

Choose the React starter kit when prompted. For more information, see the official Laravel frontend documentation.

Then move into your project directory:

cd my-app

Use the CLI

Run the CLI

Run the init command from the root of your Laravel app:

bunx --bun fabricator-ui@latest init

When asked to overwrite components.json and components, choose Yes.

Add Components

Add the Switch component to your project:

bunx --bun fabricator-ui@latest add switch

The command above will add the Switch component to resources/js/components/ui/switch.tsx. You can then import it like this:

resources/js/pages/index.tsx
import { Switch } from "@/components/ui/switch"
 
const MyPage = () => {
  return (
    <div>
      <Switch />
    </div>
  )
}
 
export default MyPage