Skip to main content
1
Create project
2
Start by creating a new Laravel project with Inertia and React using the laravel installer laravel new my-app:
3
laravel new my-app --react
4
Add Components
5
You can now start adding components to your project.
6
npx shadcn@latest add switch
7
The command above will add the Switch component to resources/js/components/ui/switch.tsx. You can then import it like this:
8
import { Switch } from "@/components/ui/switch"

const MyPage = () => {
  return (
    <div>
      <Switch />
    </div>
  )
}

export default MyPage

Build docs developers (and LLMs) love