---
title: Laravel
description: Install and configure shadcn/ui for Laravel.
---
The shadcn 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 shadcn/ui.
### Create Project
Create a new Laravel app using the Laravel installer:
```bash
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](https://laravel.com/docs/12.x/frontend).
Then move into your project directory:
```bash
cd my-app
```
Use shadcn/create
Build your preset visually and generate a Laravel init command.
Use the CLI
Configure shadcn/ui in your Laravel app directly from the terminal.
## Use shadcn/create
### Build Your Preset
Open [shadcn/create](/create?template=laravel) and build your preset visually. Choose your style, colors, fonts, icons, and more.
### Run the Command
Click `Create Project`, choose your package manager, and copy the generated command.
The generated command will look similar to this:
```bash
npx shadcn@latest init --preset [CODE] --template laravel
```
Run the command from the root of your Laravel app.
When asked to overwrite `components.json` and components, choose `Yes`.
### Add Components
Add the `Switch` component to your project:
```bash
npx shadcn@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:
```tsx title="resources/js/pages/index.tsx" showLineNumbers {1,6}
import { Switch } from "@/components/ui/switch"
const MyPage = () => {
return (
)
}
export default MyPage
```
## Use the CLI
### Run the CLI
Run the `shadcn` init command from the root of your Laravel app:
```bash
npx shadcn@latest init
```
When asked to overwrite `components.json` and components, choose `Yes`.
### Add Components
Add the `Switch` component to your project:
```bash
npx shadcn@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:
```tsx title="resources/js/pages/index.tsx" showLineNumbers {1,6}
import { Switch } from "@/components/ui/switch"
const MyPage = () => {
return (