Flowbite - Tailwind CSS components
Build websites even faster with components on top of Tailwind CSS

Discord Total Downloads Latest Release Licenese

------ ## Table of Contents - [Table of Contents](#table-of-contents) - [Documentation](#documentation) - [Getting started](#getting-started) - [Install using NPM](#install-using-npm) - [Include via CDN](#include-via-cdn) - [Bundled JavaScript](#bundled-javascript) - [Data attributes](#data-attributes) - [Init functions](#init-functions) - [ESM and CJS](#esm-and-cjs) - [TypeScript](#typescript) - [JavaScript Frameworks](#javascript-frameworks) - [Back-end Frameworks](#back-end-frameworks) - [Components](#components) - [Figma Design System](#figma-design-system) - [Flowbite Blocks](#flowbite-blocks) - [Flowbite Icons](#flowbite-icons) - [Pro version](#pro-version) - [Learn Design Concepts](#learn-design-concepts) - [Community](#community) - [Copyright and license](#copyright-and-license) ## Documentation For full documentation, visit [flowbite.com](https://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. ### Install using NPM Make sure that you have Node.js and Tailwind CSS installed. 1. Install Flowbite as a dependency using NPM by running the following command: ```bash npm install flowbite ``` 2. Require Flowbite as a plugin inside the `tailwind.config.js` file: ```javascript module.exports = { plugins: [ require('flowbite/plugin') ] } ``` 3. Make sure that you add the template path to the `tailwind.config.js` file: ```javascript module.exports = { content: [ "./node_modules/flowbite/**/*.js" ] } ``` 4. Include the main JavaScript file to make interactive elements work: ```html ``` ### Include via CDN The quickest way to get started working with Flowbite is to simply include the CSS and JavaScript into your project via a CDN service such as UNPKG or CDNJS (content delivery networks). Require the following minified stylesheet inside the `head` tag: ```html ``` And include the following javascript file before the end of the `body` tag: ```html ``` ### Bundled JavaScript One of the most popular way of using Flowbite is to include the bundled Javascript file which is UMD ready using a bundler such as Webpack or Parcel which makes sure that all of the data attributes and functionality will work out-of-the-box. You can directly import the main JavaScript file inside your bundled `app-bundle.js` file like this: ```javascript import 'flowbite'; ``` This file has access to all of the components and it automatically applies event listeners to the data attributes. ### Data attributes The preferred way to use the interactive UI components from Flowbite is via the data attributes interface which allows us to add functionality via the HTML element attributes and most of the examples on our documentation applies this strategy. For example, to set up a modal component all you need to do is use `data-modal-target` and `data-modal-{toggle|show|hide}` to toggle, show, or hide the component by clicking on any trigger element. ```html ``` #### Init functions You can also use the init functions to set up the event listeners yourself. Here's an example how you can do it with Vue or Nuxt: ``` ``` The `initFlowbite` function sets up all of the init functions for dropdowns, modals, navbars, tooltips and so on to hook onto the data attributes. Alternatively, you can also initialise each component category class separately with `initDropdowns` or `initModals`. You can view more examples by browsing the [components from Flowbite](#components). ### ESM and CJS Flowbite also offers an API for using the components programmatically and it supports both CJS and ESM for JavaScript which can be helpful if you need to expand the default capabilities of the data attributes interface and get access to function callbacks. Here's an example how you can import and create a new Modal component inside JavaScript: ```javascript import { Modal } from 'flowbite' const $modalElement = document.querySelector('#modalEl'); const modalOptions = { placement: 'bottom-right', backdrop: 'dynamic', backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', onHide: () => { console.log('modal is hidden'); }, onShow: () => { console.log('modal is shown'); }, onToggle: () => { console.log('modal has been toggled'); } } const modal = new Modal($modalElement, modalOptions); modal.show(); ``` Check out the JavaScript behaviour section of each component's page to learn how you can use this. ### TypeScript Flowbite supports type declarations for the interactive UI components including object interfaces and parameter types. Check out the following examples to learn how you can use types with Flowbite. Additionally to our code above, we will now import some relevant types from the Flowbite package, namely the `ModalOptions` and `ModalInterface`: ```javascript import { Modal } from 'flowbite' import type { ModalOptions, ModalInterface } from 'flowbite' // other code ``` Generally speaking, all of the components have an interface definition that you can use whenever you create a new object to make sure that you're using the correct types of parameters and methods. When creating a new modal you can set the `ModalInterface` as the main type: ```javascript const modal: ModalInterface = new Modal($modalElement, modalOptions); ``` Flowbite also supports type definitions for the options object so if you want to set the placement of the modal based on types, here's how you would do that: ```javascript const modalOptions: ModalOptions = { placement: 'top-right' } const modal: ModalInterface = new Modal($modalElement, modalOptions); ``` Learn more about Flowbite and TypeScript in the [quickstart guide](https://flowbite.com/docs/getting-started/typescript/). ### JavaScript Frameworks The awesome open-source community also built and currently maintains the following standalone libraries for React, Vue, Svelte, and Angular: - [πŸŒ€ Flowbite React Library](https://github.com/themesberg/flowbite-react) - [πŸ€ Flowbite Vue Library](https://github.com/themesberg/flowbite-vue) - [🎸 Flowbite Svelte Library](https://github.com/themesberg/flowbite-svelte) - [πŸ“• Flowbite Angular Library](https://github.com/themesberg/flowbite-angular) We also wrote integration guides for the following front-end frameworks and libraries: - [πŸ“ Flowbite with React guide](https://flowbite.com/docs/getting-started/react/) - [πŸ“ Flowbite with Next.js guide](https://flowbite.com/docs/getting-started/next-js/) - [πŸ“ Flowbite with Remix guide](https://flowbite.com/docs/getting-started/remix/) - [πŸ“ Flowbite with Vue guide](https://flowbite.com/docs/getting-started/vue/) - [πŸ“ Flowbite with Nuxt guide](https://flowbite.com/docs/getting-started/nuxt-js/) - [πŸ“ Flowbite with Svelte guide](https://flowbite.com/docs/getting-started/svelte/) - [πŸ“ Flowbite with Astro guide](https://flowbite.com/docs/getting-started/astro/) - [πŸ“ Flowbite with Gatsby guide](https://flowbite.com/docs/getting-started/gatsby/) - [πŸ“ Flowbite with SolidJS guide](https://flowbite.com/docs/getting-started/solid-js/) ### Back-end Frameworks Flowbite has a great integration with most of the back-end frameworks because it relies on vanilla JavaScript: - [πŸ“š Using Flowbite with Laravel](https://flowbite.com/docs/getting-started/laravel/) - [🎼 Using Flowbite with Symfony](https://flowbite.com/docs/getting-started/symfony/) - [🚊 Using Flowbite with Ruby on Rails 7](https://flowbite.com/docs/getting-started/rails/) - [πŸ‰ Using Flowbite with Phoenix (Elixir)](https://flowbite.com/docs/getting-started/phoenix/) - [🐸 Using Flowbite with Django](https://flowbite.com/docs/getting-started/django/) - [🌢 Using Flowbite with Flask](https://flowbite.com/docs/getting-started/flask/) ## Components Flowbite is an open source collection of UI components built with the utility classes from Tailwind CSS that you can use as a starting point when coding user interfaces and websites.
Alerts Badge Breadcrumbs
Tailwind CSS Alerts Tailwind CSS Badge Tailwind CSS Breadcrumbs
Buttons Button group Cards
Tailwind CSS Buttons Tailwind CSS Button Group Tailwind CSS Cards
Dropdown Forms List group
Tailwind CSS Dropdown Tailwind CSS Forms Tailwind CSS List group
Typography Modal Tabs
Tailwind CSS Typography Tailwind CSS Modal Tailwind CSS Tabs
Navbar Pagination Timeline
Tailwind CSS Navbar Tailwind CSS Pagination Tailwind CSS Timeline
Progress bar Tables Toast
Tailwind CSS Progress Bar Tailwind CSS Tables Tailwind CSS Toast
Tooltips Datepicker Spinner
Tailwind CSS Tooltips Tailwind CSS Datepicker Tailwind CSS Spinner
Footer Accordion Sidebar
Tailwind CSS Footer Tailwind CSS Accordion Tailwind CSS Sidebar
Carousel Avatar Rating
Tailwind CSS Carousel Tailwind CSS Avatar Tailwind CSS Rating
Input Field File Input Search Input
Tailwind CSS Input Field Tailwind CSS File Input Tailwind CSS Search Input
Select Textarea Checkbox
Tailwind CSS Select Tailwind CSS Textarea Tailwind CSS Checkbox
Radio Toggle Range Slider
Tailwind CSS Radio Tailwind CSS Toggle Tailwind CSS Range Slider
Floating Label Mega Menu Skeleton
Tailwind CSS Floating Label Tailwind CSS Mega Menu Tailwind CSS Skeleton
KBD (keyboard) Drawer (offcanvas) Popover
Tailwind CSS KBD (Keyboard) Tailwind CSS Drawer (offcanvas) Tailwind CSS Popover
Video Heading Paragraph
Tailwind CSS Video Tailwind CSS Heading Tailwind CSS Paragraph
Blockquote Image List
Tailwind CSS Blockquote Tailwind CSS Image Tailwind CSS List
Link Text Horizontal line (HR)
Tailwind CSS Link Tailwind CSS Text Tailwind CSS HR
Speed Dial Stepper Indicators
Tailwind CSS Speed Dial Tailwind CSS Stepper Tailwind CSS Indicators
Bottom Navigation Sticky Banner Gallery (Masonry)
Tailwind CSS Bottom Navigation Bar Tailwind CSS Bottom Sticky Banner Tailwind CSS Image Gallery (Masonry)
Jumbotron Device mockups Charts
Tailwind CSS Jumbotron Tailwind CSS Device Mockups Tailwind CSS Charts
## Figma Design System 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](https://flowbite.com/figma/) ## Flowbite Blocks Check out Flowbite Blocks to get access to over 330+ website sections coded in Tailwind CSS and Flowbite: πŸ“¦ [Check out Flowbite Blocks](https://flowbite.com/blocks/) ## Flowbite Icons Start using over 430+ free and open-source collection of solid and outline SVG icons built for Tailwind CSS and with support for Figma and JSX (React): πŸ” [Check out the icons](https://flowbite.com/icons/) ## Pro version Get access to all premium features including the Figma design system, access to all Flowbite Block sections and a dashboard UI interface: πŸ’Ž [Check out Flowbite Pro](https://flowbite.com/pro/) ## Learn Design Concepts If you want to create even better Flowbite pages, learn design fundamentals from Teach Me Design - Enhance UI, a book that covers color theory, typography, UI and UX so you can make the most to implement the Flowbite Ecosystem! πŸ“– [Learn with Enhance UI](https://www.enhanceui.com/?ref=flowbite-github) ## Community If you need help or just want to discuss about the library join the community on Github: ⌨️ [Discuss about Flowbite on GitHub](https://github.com/themesberg/flowbite/discussions) For casual chatting with others using the library: πŸ’¬ [Join the Flowbite Discord Server](https://discord.gg/4eeurUVvTy) Video tutorials and presentations using Flowbite: πŸŽ₯ [Subscribe to our YouTube channel](https://www.youtube.com/channel/UC_Ms4V2kYDsh7F_CSsHyQ6A) ## Copyright and license The Flowbite name and logos are trademarks of Bergside Inc. - πŸ“ [Read about the licensing terms](https://flowbite.com/docs/getting-started/license/) - πŸ“€ [Brand guideline and trademark usage agreement](https://flowbite.com/brand/)