├── .gitignore ├── .vscode └── extensions.json ├── LICENSE.md ├── README.md ├── index.html ├── package.json ├── public └── vite.svg ├── src ├── App.vue ├── assets │ └── vue.svg ├── components │ └── HelloWorld.vue ├── main.js ├── router │ └── index.js ├── style.css └── views │ ├── Accordion.vue │ ├── Carousel.vue │ ├── Collapse.vue │ ├── Datepicker.vue │ ├── Dial.vue │ ├── Dismiss.vue │ ├── Drawer.vue │ ├── Dropdown.vue │ ├── Events.vue │ ├── InputCounter.vue │ ├── Modal.vue │ ├── Popover.vue │ ├── Tabs.vue │ └── Tooltip.vue └── vite.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tailwind 4 Vue Starter 2 | 3 | [Follow this guide](https://flowbite.com/docs/getting-started/vue/) to learn how to set up Tailwind CSS v4 with Vue and Flowbite. 4 | 5 | ## Create a Vue project 6 | 7 | Follow the next steps to install Tailwind CSS (with v4) and Flowbite with Vue 3 and Vite. 8 | 9 | 1. Create a new Vite project running the following commands in your terminal: 10 | 11 | ```bash 12 | npm create vite@latest flowbite-app -- --template vue 13 | cd flowbite-app 14 | ``` 15 | 16 | ## Install Tailwind CSS 17 | 18 | This guide uses the newest version of Tailwind CSS v4 which brings many improvements. 19 | 20 | 1. Install Tailwind CSS using Vite via the terminal: 21 | 22 | ```bash 23 | npm install tailwindcss @tailwindcss/vite --save 24 | ``` 25 | 26 | 2. Add the Tailwind plugin inside your `vite.config.js` file: 27 | 28 | ```javascript 29 | import { defineConfig } from 'vite' 30 | import vue from '@vitejs/plugin-vue' 31 | import tailwindcss from '@tailwindcss/vite' 32 | 33 | // https://vite.dev/config/ 34 | export default defineConfig({ 35 | plugins: [ 36 | vue(), 37 | tailwindcss() 38 | ], 39 | }) 40 | ``` 41 | 42 | 3. Import the `tailwind` module inside your `style.css` file: 43 | 44 | ```css 45 | @import "tailwindcss"; 46 | ``` 47 | 48 | You have now installed both Tailwind CSS and Vue and can proceed with the next steps. 49 | 50 | ## Install Flowbite 51 | 52 | The UI components from Flowbite can help you save time building websites with Vue and Tailwind. Make sure that you follow the next steps to ensure that you install both the CSS and JavaScript dependencies. 53 | 54 | 1. Install Flowbite as a dependency using NPM by running the following command: 55 | 56 | ```bash 57 | npm install flowbite --save 58 | ``` 59 | 60 | 2. Import the default theme variables from Flowbite inside your main `input.css` CSS file: 61 | 62 | ```css 63 | @import "flowbite/src/themes/default"; 64 | ``` 65 | 66 | 3. Import the Flowbite plugin file in your CSS: 67 | 68 | ```css 69 | @plugin "flowbite/plugin"; 70 | ``` 71 | 72 | 4. Configure the source files of Flowbite in your CSS: 73 | 74 | ```css 75 | @source "../node_modules/flowbite"; 76 | ``` 77 | 78 | ## Flowbite Components 79 | 80 | Now that you have successfully installed Vue, 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. 81 | 82 | 83 | 4. Start a local development server by running the following command in your terminal: 84 | 85 | ```bash 86 | npm run dev 87 | ``` 88 | 89 | If you want to build the project then you can run `npm run build`. 90 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Vue 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tailwind-vue-starter", 3 | "version": "1.0.0", 4 | "description": "A free and open-source starter project to help you get started with the core Flowbite Library components and Vue 3", 5 | "license": "MIT", 6 | "repository": "https://github.com/themesberg/tailwind-vue-starter", 7 | "homepage": "https://flowbite.com/docs/getting-started/vue/", 8 | "contributors": [ 9 | "Zoltán Szőgyényi (https://twitter.com/zoltanszogyenyi)" 10 | ], 11 | "author": "Bergside Inc.", 12 | "type": "module", 13 | "scripts": { 14 | "dev": "vite", 15 | "build": "vite build", 16 | "preview": "vite preview" 17 | }, 18 | "dependencies": { 19 | "@tailwindcss/vite": "^4.0.8", 20 | "flowbite": "^3.1.2", 21 | "tailwindcss": "^4.0.8", 22 | "vue": "^3.5.13", 23 | "vue-router": "^4.5.0" 24 | }, 25 | "devDependencies": { 26 | "@vitejs/plugin-vue": "^5.2.1", 27 | "vite": "^6.1.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 3 | 4 | 31 | -------------------------------------------------------------------------------- /src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 82 | 83 | 88 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import './style.css' 3 | import router from './router' 4 | import App from './App.vue' 5 | 6 | createApp(App).use(router).mount('#app') 7 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createWebHistory, createRouter } from "vue-router"; 2 | import Events from "../views/Events.vue"; 3 | import Accordion from "../views/Accordion.vue"; 4 | import Carousel from "../views/Carousel.vue"; 5 | import Collapse from "../views/Collapse.vue"; 6 | import Dial from "../views/Dial.vue"; 7 | import Dismiss from "../views/Dismiss.vue"; 8 | import Drawer from "../views/Drawer.vue"; 9 | import Dropdown from "../views/Dropdown.vue"; 10 | import Popover from "../views/Popover.vue"; 11 | import Tabs from "../views/Tabs.vue"; 12 | import Tooltip from "../views/Tooltip.vue"; 13 | import Modal from "../views/Modal.vue"; 14 | import InputCounter from "../views/InputCounter.vue"; 15 | import Datepicker from "../views/Datepicker.vue"; 16 | 17 | const routes = [ 18 | { 19 | path: "/events", 20 | name: "Events", 21 | component: Events, 22 | }, 23 | { 24 | path: "/accordion", 25 | name: "Accordion", 26 | component: Accordion, 27 | }, 28 | { 29 | path: "/carousel", 30 | name: "Carousel", 31 | component: Carousel, 32 | }, 33 | { 34 | path: "/collapse", 35 | name: "Collapse", 36 | component: Collapse, 37 | }, 38 | { 39 | path: "/dial", 40 | name: "Dial", 41 | component: Dial, 42 | }, 43 | { 44 | path: "/dismiss", 45 | name: "Dismiss", 46 | component: Dismiss, 47 | }, 48 | { 49 | path: "/drawer", 50 | name: "Drawer", 51 | component: Drawer, 52 | }, 53 | { 54 | path: "/dropdown", 55 | name: "Dropdown", 56 | component: Dropdown, 57 | }, 58 | { 59 | path: "/popover", 60 | name: "Popover", 61 | component: Popover, 62 | }, 63 | { 64 | path: "/tabs", 65 | name: "Tabs", 66 | component: Tabs, 67 | }, 68 | { 69 | path: "/tooltip", 70 | name: "Tooltip", 71 | component: Tooltip, 72 | }, 73 | { 74 | path: "/modal", 75 | name: "Modal", 76 | component: Modal, 77 | }, 78 | { 79 | path: "/input-counter", 80 | name: "InputCounter", 81 | component: InputCounter, 82 | }, 83 | { 84 | path: "/datepicker", 85 | name: "Datepicker", 86 | component: Datepicker, 87 | }, 88 | ]; 89 | 90 | const router = createRouter({ 91 | history: createWebHistory(), 92 | routes, 93 | }); 94 | 95 | export default router; -------------------------------------------------------------------------------- /src/style.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 | -------------------------------------------------------------------------------- /src/views/Accordion.vue: -------------------------------------------------------------------------------- 1 | 60 | 61 | 106 | -------------------------------------------------------------------------------- /src/views/Carousel.vue: -------------------------------------------------------------------------------- 1 | 85 | 86 | 132 | -------------------------------------------------------------------------------- /src/views/Collapse.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 54 | -------------------------------------------------------------------------------- /src/views/Datepicker.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | -------------------------------------------------------------------------------- /src/views/Dial.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 88 | -------------------------------------------------------------------------------- /src/views/Dismiss.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 49 | -------------------------------------------------------------------------------- /src/views/Drawer.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 42 | -------------------------------------------------------------------------------- /src/views/Dropdown.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 61 | -------------------------------------------------------------------------------- /src/views/Events.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | -------------------------------------------------------------------------------- /src/views/InputCounter.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 55 | -------------------------------------------------------------------------------- /src/views/Modal.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 54 | -------------------------------------------------------------------------------- /src/views/Popover.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 52 | -------------------------------------------------------------------------------- /src/views/Tabs.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 89 | -------------------------------------------------------------------------------- /src/views/Tooltip.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 47 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | import tailwindcss from '@tailwindcss/vite' 4 | 5 | // https://vite.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | vue(), 9 | tailwindcss() 10 | ], 11 | }) 12 | --------------------------------------------------------------------------------