Laravel Installation

Install and configure your UI components for Laravel with Inertia and React.

Create project

Start by creating a new Laravel project with Inertia and React using the Laravel installer:

1laravel new my-app --react

Add Components

You can now start adding components to your project. For example, to add the Switch component:

pnpm dlx shadcn@latest add switch

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

1import { Switch } from "@/components/ui/switch"
2
3const MyPage = () => {
4 return (
5 <div>
6 <Switch />
7 </div>
8 )
9}
10
11export default MyPage

For more details, see the documentation for each component.