├── public ├── robots.txt └── favicon.ico ├── server └── tsconfig.json ├── .DS_Store ├── app.vue ├── .gitignore ├── tsconfig.json ├── assets └── css │ └── input.css ├── composables └── useFlowbite.js ├── nuxt.config.ts ├── package.json ├── LICENSE.md ├── pages ├── Dismiss.vue ├── Tooltip.vue ├── Datepicker.vue ├── Popover.vue ├── Collapse.vue ├── Dropdown.vue ├── Input-Counter.vue ├── Drawer.vue ├── Modal.vue ├── index.vue ├── Tabs.vue ├── Dial.vue ├── Carousel.vue ├── Accordion.vue └── Events.vue └── README.md /public/robots.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.nuxt/tsconfig.server.json" 3 | } 4 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themesberg/tailwind-nuxt-starter/HEAD/.DS_Store -------------------------------------------------------------------------------- /app.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log* 3 | .nuxt 4 | .nitro 5 | .cache 6 | .output 7 | .env 8 | dist 9 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themesberg/tailwind-nuxt-starter/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /assets/css/input.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss"; 2 | 3 | @import "flowbite/src/themes/default"; 4 | @plugin "flowbite/plugin"; 5 | @source "../../node_modules/flowbite"; 6 | @source "../../node_modules/flowbite-datepicker"; 7 | -------------------------------------------------------------------------------- /composables/useFlowbite.js: -------------------------------------------------------------------------------- 1 | // composables/useFlowbite.js 2 | 3 | export function useFlowbite(callback) { 4 | if (process.client) { 5 | import('flowbite').then((flowbite) => { 6 | callback(flowbite); 7 | }); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import tailwindcss from "@tailwindcss/vite"; 2 | export default defineNuxtConfig({ 3 | devtools: { enabled: true }, 4 | css: ['~/assets/css/input.css'], 5 | 6 | vite: { 7 | plugins: [ 8 | tailwindcss(), 9 | ], 10 | }, 11 | 12 | compatibilityDate: "2025-02-28", 13 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tailwind-nuxt-starter", 3 | "version": "2.0.0", 4 | "description": "A free and open-source starter project to help you get started with the core Flowbite Library components and Nuxt.js", 5 | "license": "MIT", 6 | "repository": "https://github.com/themesberg/tailwind-nuxt-starter", 7 | "homepage": "https://flowbite.com/docs/getting-started/nuxt/", 8 | "contributors": [ 9 | "Zoltán Szőgyényi (https://twitter.com/zoltanszogyenyi)" 10 | ], 11 | "author": "Bergside Inc.", 12 | "type": "module", 13 | "scripts": { 14 | "build": "nuxt build", 15 | "dev": "nuxt dev", 16 | "generate": "nuxt generate", 17 | "preview": "nuxt preview", 18 | "postinstall": "nuxt prepare" 19 | }, 20 | "dependencies": { 21 | "@tailwindcss/vite": "^4.0.9", 22 | "flowbite": "^3.1.2", 23 | "nuxt": "^3.15.4", 24 | "tailwindcss": "^4.0.9", 25 | "vue": "latest", 26 | "vue-router": "latest" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Bergside Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /pages/Dismiss.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /pages/Tooltip.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /pages/Datepicker.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | -------------------------------------------------------------------------------- /pages/Popover.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | -------------------------------------------------------------------------------- /pages/Collapse.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /pages/Dropdown.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tailwind 4 Nuxt Starter 2 | 3 | If you [follow this guide](https://flowbite.com/docs/getting-started/nuxt-js/) 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. 4 | 5 | ## Create a Nuxt project 6 | 7 | Before continuing make sure that you have Node.js and NPM installed on your local machine. 8 | 9 | 1. Create a new Nuxt project by running the following command in your terminal: 10 | 11 | ```bash 12 | npx nuxi init flowbite-app 13 | cd flowbite-app 14 | ``` 15 | 16 | 2. Install the project dependencies by executing the following command: 17 | 18 | ```bash 19 | npm install 20 | ``` 21 | 22 | 3. Run the following command to start a local development server on `http://localhost:3000/`: 23 | 24 | ```bash 25 | npm run dev 26 | ``` 27 | 28 | This will make the Nuxt project accessible via the browser. 29 | 30 | ## Install Tailwind CSS 31 | 32 | Now that you have locally set up a Nuxt project we will proceed by installing Tailwind CSS. 33 | 34 | 1. Require and install the NuxtTailwind module by installing it via NPM: 35 | 36 | ```bash 37 | npm install tailwindcss @tailwindcss/vite --save 38 | ``` 39 | 40 | 2. Configure the Nuxt configuration file to include the Tailwind module: 41 | 42 | ```javascript 43 | import tailwindcss from "@tailwindcss/vite"; 44 | 45 | export default defineNuxtConfig({ 46 | devtools: { enabled: true }, 47 | css: ['~/assets/css/input.css'], // you'll have to create this file 48 | vite: { 49 | plugins: [ 50 | tailwindcss(), 51 | ], 52 | }, 53 | }); 54 | ``` 55 | 56 | 3. Create a new CSS file `./assets/css/input.css` and import Tailwind: 57 | 58 | ```css 59 | @import "tailwindcss"; 60 | ``` 61 | 62 | 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. 63 | 64 | ## Install Flowbite 65 | 66 | After installing both Nuxt and Tailwind CSS inside your project we can proceed by installing Flowbite. 67 | 68 | 1. Install Flowbite as a dependency using NPM by running the following command: 69 | 70 | ```bash 71 | npm install flowbite --save 72 | ``` 73 | 74 | 2. Import the default theme variables from Flowbite inside your main `input.css` CSS file: 75 | 76 | ```css 77 | @import "flowbite/src/themes/default"; 78 | ``` 79 | 80 | 3. Import the Flowbite plugin file in your CSS: 81 | 82 | ```css 83 | @plugin "flowbite/plugin"; 84 | ``` 85 | 86 | 4. Configure the source files of Flowbite in your CSS: 87 | 88 | ```css 89 | @source "../../node_modules/flowbite"; 90 | ``` 91 | 92 | ## Flowbite Components 93 | 94 | 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](https://flowbite.com) such as modals, navbars, tables, dropdowns, and more. 95 | -------------------------------------------------------------------------------- /pages/Input-Counter.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | -------------------------------------------------------------------------------- /pages/Drawer.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /pages/Modal.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /pages/Tabs.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | -------------------------------------------------------------------------------- /pages/Dial.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | -------------------------------------------------------------------------------- /pages/Carousel.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | -------------------------------------------------------------------------------- /pages/Accordion.vue: -------------------------------------------------------------------------------- 1 | 62 | 63 | -------------------------------------------------------------------------------- /pages/Events.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | --------------------------------------------------------------------------------