If you follow this guide you will learn how to install the latest version 3 of Nuxt with Tailwind CSS v4 and Flowbite and also show you how to use the TypeScript version.
Before continuing make sure that you have Node.js and NPM installed on your local machine.
npx nuxi init flowbite-app
cd flowbite-app
npm install
http://localhost:3000/
:npm run dev
This will make the Nuxt project accessible via the browser.
Now that you have locally set up a Nuxt project we will proceed by installing Tailwind CSS.
npm install tailwindcss @tailwindcss/vite --save
import tailwindcss from "@tailwindcss/vite";
export default defineNuxtConfig({
devtools: { enabled: true },
css: ['~/assets/css/input.css'], // you'll have to create this file
vite: {
plugins: [
tailwindcss(),
],
},
});
./assets/css/input.css
and import Tailwind:@import "tailwindcss";
Tailwind CSS is now configured in your project and if you add the utility classes anywhere in your Vue template files the CSS will be generated and included.
After installing both Nuxt and Tailwind CSS inside your project we can proceed by installing Flowbite.
npm install flowbite --save
input.css
CSS file:@import "flowbite/src/themes/default";
@plugin "flowbite/plugin";
@source "../../node_modules/flowbite";
Now that you have successfully installed Nuxt, Tailwind CSS and Flowbite you can start importing and using components from the open-source library of Flowbite such as modals, navbars, tables, dropdowns, and more.