Build websites even faster with components on top of Tailwind CSS
Documentation
For full documentation, visit flowbite.com.
Getting started
Flowbite can be included as a plugin into an existing Tailwind CSS project and it is supposed to help you build websites faster by having a set of web components to work with built with the utility classes from Tailwind CSS.
Require via NPM
Make sure that you have Node.js and Tailwind CSS installed.
- Install Flowbite as a dependency using NPM by running the following command:
npm i @themesberg/flowbite
- Require Flowbite as a plugin inside the
tailwind.config.js
file:
module.exports = {
plugins: [
require('@themesberg/flowbite/plugin')
]
}
- Include the main JavaScript file to make interactive elements work:
<script src="../path/to/@themesberg/flowbite/dist/flowbite.bundle.js"></script>
If you use Webpack or other bundlers you can also import it like this:
import '@themesberg/flowbite';
Include via CDN
The quickest way to get started working with FlowBite is to simply include the CSS and JavaScript into your project via CDN.
Require the following minified stylesheet inside the head
tag:
<link rel="stylesheet" href="https://unpkg.com/@themesberg/[email protected]/dist/flowbite.min.css" />
And include the following javascript file before the end of the body
element:
<script src="https://unpkg.com/@themesberg/[email protected]/dist/flowbite.bundle.js"></script>
Community
If you need help or just want to discuss about the library join the community on Github:
Discuss about Flowbite on GitHub
For casual chatting with others using the library:
Join the Flowbite Discord Server
Figma
If you need the Figma files for the components you can check out our website for more information:
Get access to the Figma design files
flowbite not working with NextJS
Issue
import '@themesberg/flowbite';
we get an errordocument not found
.<script src="../path/to/@themesberg/flowbite/dist/flowbite.bundle.js"></script>
? Is thepath/to
just a placeholder for another custom local path?modal open with javascript, not close correctly
Describe the bug if open modal with javascript, i can't close modal with javascript helper or data-modal-toggle=""
To Reproduce Steps to reproduce the behavior:
new Modal(document.getElementById('defaultModal'), null).show();
Expected behavior close correctly modal
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.
Flowbite with Turbo on rails7
Hi! ๐
Firstly, thanks for your work on this project! ๐
I got Flowbite working together with Turbo in my Rails 7 project. The original issue was that the javascript worked until the first turbo navigation was made and stoped working after that.
According to Turbo's documentaction this happened because Flowbite uses
DOMContentLoaded
event to install JS behavior, but this event only fires once, in response to the initial page load. In order to install the JS behavior on every page change I replacedDOMContentLoaded
toturbo:load
event indist/flowbite.js
.turbo:load
event fires on every page change.I used patch-package to patch
[email protected]
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
Javascript doesn't work in Vue3
Hey there, I am using a fresh project with tailwind2, flowbite 1.1.1 and vue3. The backend stack ist laravel 8 (php8) with inertia.js. If I'm creating a modal inside a Vue component, then I can't open/toggle the model (data-modal-toggle="default-modal" is set to the button) . It only works, if i move the button and modal out of the component, into the final html generated site (with Blade Template Engin). It affects not only the modal, but also the alert dismiss button and basically everything that need flowbite javascript.
Has someone the same issue and know a workaround?
Dropdowns don't work in React if rendered after page load
Describe the bug When using Flowbite with React, if the page updates after first load to include a dropdown that wasn't originally present then the dropdown doesn't open when clicked.
I assume this applies to all JavaScript but I've not tried any others yet.
There are no console errors and nothing obvious at all in any logs. It just only ever works if the Dropdown HTML was present in the first render, and doesn't work if it was only present after an update.
My assumption is that the event listeners are bound to the HTML as it is when the JavaScript first runs, and doesn't use any mechanism to bind to changes that happen later.
Desktop (please complete the following information):
Not able to set up Flowbite on SvelteKit
Describe the bug
I'm trying to install Flowbite on SvelteKit. When I run
npm run dev
, I get an error:To Reproduce
Install SvelteKit:
Install Tailwind Css and Flowbite:
Update the TailwindCSS config.
In the tailwind.config.cjs file:
Adding flowbite to
routes/__layout.svelte
:Expected behavior
No error.
Screenshots
Desktop (please complete the following information):
Modal does not open when switching between pages until you refresh the page
in mobile screen when the page load for the first time and you click the button to open the modal it does open, but after you go to another page and try to open another modal it does not open and you should refresh the page again and again every time you go to another page.
Modal doesn't close when clicking background or hitting esc button
Describe the bug
Common expected modal functionality is to click outside of the modal to close the modal. Same goes for hitting the esc button.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect the modal to close on either of those. The modal doesn't. I have to click the close button instead.
Desktop:
Smartphone:
Additional context I've replicated this on my local dev and on the Flowbite demo site.
JS elements not working in Webpack with Tailwind v3
Describe the bug I have a fresh installation of Tailwindcss 3 and latest version of Flowbite installed via NPM and using Webpack 5 as my bundler. Flowbite styles are working perfectly but all JS powered elements aren't working it seems.
To Reproduce Steps to reproduce the behavior:
Expected behavior JS elements should be working, but they don't seem to be
Desktop (please complete the following information):
Additional context Add any other context about the problem here.
Dropdown offset
At the moment the dropdown offset is hardcoded to
[0, 10]
.It would be great to add support for a new data attribute like
data-dropdown-offset="0,10"
. Or possiblydata-dropdown-offset-x="0"
anddata-dropdown-offset-y="10"
. Easier to parse in the code but I personally prefer the first option.Meanwhile, the workaround I found was to add Tailwind classes like
!-bottom-2
to override the position.Let me know your thoughts. Thanks for the great library!
default integration doesn't seem to work for nuxt js
Is your feature request related to a problem? Please describe. the methods that are described in the default quickstart guide doesn't seem to work for nuxt.js v2.15. please elaborate it.
Describe the solution you'd like a proper guide on how to integrate with some document /video on how to integrate with different frontend frameworks. (in my case vue js applications)
Node Express EJS Template Engine can not get Flowbite JavaScript
Describe the bug I am using Flowbite in my Node Express project where I'm using Flowbite as Tailwind Plugin. But, Node Express EJS Template Engine can not get Flowbite JavaScript. It can not dismiss the alert element, and more where JS needs to work.
To Reproduce Steps to reproduce the behavior:
"./views/**/*.ejs"
in tailwind config file, addrequire('flowbite/plugin')
in tailwind config fileExpected behavior When clicking in Alert components close dismissal, the component should be removed from the view file
Screenshots

Desktop (please complete the following information):
Accordion, Dropdown, Modal, dst. not working in jquery laravel, how to solve it?
function updateResults(results) { // Clear the previous search results $('#search-results').empty();
Can we use Windi CSS instead of Tailwind?
Is your feature request related to a problem? Please describe. I've just learned about Windi CSS and it looks like a superior alternative to Tailwind. Most importantly (to me anyway): it offers better performance (for developers and users). (BTW, an interesting read: https://antfu.me/posts/reimagine-atomic-css)
Do you think that Flowbite can be used together with Windi (instead of Tailwind)? I don't know if/which modifications that would require. Maybe it just works out of the box, but if so I don't know if it would have hidden side effects.
Describe the solution you'd like Allow Flowbite to work with Windi CSS. ๐ฅณ
Describe alternatives you've considered Keep on using Tailwind. ๐
More resilient select field regarding width
Is your feature request related to a problem? Please describe.
As the select form field is tagged with
w-full
, it is usually large:However, if we remove this class, the select's caret now overlaps the content:
It would be convenient if we could remove
w-full
and still have a good-looking select.Describe the solution you'd like
After we remove
w-full
, we get something like:In other words, the select field is large enough so the caret never overlaps the content, whatever the selected option.
Describe alternatives you've considered
Workarounds:
(not proud of this one)flowbite version 1.5.5: CSP problem
Describe the bug With version 1.5.5 , i have a problem with CSP (Content Security Policy):
With the same code and flowbite version 1.5.4, all is ok (no problem with CSP).
To Reproduce I have a simple application (just header and slider, no javascript, just 'import flowbite'). I use webpack (with laravel-mix) With version 1.5.4, all is ok. Example: https://inwayvideo.com/flowbitecsp1/
With the same code, I just change version of flowbite with version 1.5.5 There is a problem with CSP.
Example: https://inwayvideo.com/flowbitecsp2/ Use chrome and open console to show message
Code is here (in a zip file): http://inwayvideo.com/flowbitecsp/flowbiteBugCSP.zip read readme.txt to build demo
Expected behavior No message for CSP
Desktop (please complete the following information):
Philippe