title | description |
---|---|
Use with Next.js - Flowbite React |
Copy the starter or follow the steps below to get started with Flowbite React in Next.js. |
- Install dependencies:
npm install --save autoprefixer postcss tailwindcss flowbite flowbite-react
- Create
postcss.config.js
:
module.exports = {
plugins: {
autoprefixer: {},
tailwindcss: {},
},
};
- Create
tailwind.config.js
:
/**
* @type {import('@types/tailwindcss/tailwind-config').TailwindConfig}
*/
module.exports = {
content: ['./node_modules/flowbite-react/**/*.js', './pages/**/*.{ts,tsx}', './public/**/*.html'],
plugins: [require('flowbite/plugin')],
theme: {},
};
- And replace the contents of
styles/globals.css
by:
@tailwind base;
@tailwind components;
@tailwind utilities;
- Start using
flowbite-react
!
import { Alert } from 'flowbite-react';
export default function MyPage() {
return <Alert color="info">Alert!</Alert>;
}