Use with Laravel - Flowbite React
Learn how to install Flowbite React for your Laravel project using Inertia and start building modern websites with the most popular PHP framework in the world
This guide provides three ways to integrate Flowbite React with Laravel:
- Quick Start: Create a new project with everything pre-configured
- Add to Existing Project: Add Flowbite React to an existing Laravel project
- Manual Setup: Set up everything from scratch manually
Quick Start (Recommended)
#
Quick StartThe fastest way to get started is using our project creation CLI, which sets up a new Laravel project with Flowbite React, Tailwind CSS, and all necessary configurations:
npx create-flowbite-react@latest -t laravel
This will:
- Create a new Laravel project
- Install and configure Tailwind CSS
- Set up Flowbite React with all required dependencies
- Configure Inertia.js and React
- Set up example components
Add to Existing Project
#
Add to Existing ProjectIf you already have a Laravel project and want to add Flowbite React, you can use our initialization CLI:
npx flowbite-react@latest init
This will automatically:
- Install Flowbite React and its dependencies
- Configure Tailwind CSS to include Flowbite React plugin
- Set up necessary configurations
Manual Setup
#
Manual SetupIf you prefer to set everything up manually or need more control over the configuration, follow these steps:
#
1. Create Laravel ProjectCreate a new Laravel project with Inertia.js and React support:
laravel new flowbite-react-laravel --react
#
2. Install Flowbite ReactInstall Flowbite React:
npx flowbite-react@latest init
This will:
- Install Flowbite React and its dependencies
- Configure Tailwind CSS to include Flowbite React plugin
- Configure Vite to include Flowbite React plugin
#
Try it outNow that you have successfully installed Flowbite React you can start using the components from the library:
// resources/js/pages/welcome.tsx
import { Button } from "flowbite-react";
export default function Welcome() {
return <Button>Click me</Button>;
}