Registry / web-framework / flowbite-react

flowbite-react

JSON →
library0.12.17jsnpmunverified

Flowbite React is an open-source library providing official React components built on top of the Flowbite design system and styled with Tailwind CSS utility classes. It aims to accelerate web development by offering a collection of pre-built, interactive UI components like buttons, modals, navigation bars, and forms. Currently at version 0.12.17, the library maintains an active development pace with frequent patch releases addressing bug fixes, performance improvements (e.g., recent bundle size reduction), and new features. Its key differentiators include being the official React implementation of Flowbite, deep integration with Tailwind CSS for customizable styling, and providing robust TypeScript support for enhanced developer experience. It targets React 18 and 19, and Tailwind CSS 3 and 4, ensuring compatibility with modern React ecosystems.

npm install flowbite-react
INSTALL
IMPORT
SIG · FLOWBITE-REACT
F
flowbite-react
web-frameworkjavascriptv0.12.17
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Button
import { Button } from 'flowbite-react';
import Button from 'flowbite-react';
Most Flowbite React components are named exports.
Modal
import { Modal } from 'flowbite-react';
const Modal = require('flowbite-react').Modal;
Flowbite React is primarily designed for ESM environments. Nested components like Modal.Header are accessed as properties of the main export.
Flowbite
import { Flowbite } from 'flowbite-react';
import { ThemeProvider } from 'flowbite-react';
The 'Flowbite' component acts as a context provider for theming and configuration, often mistakenly sought under a generic 'ThemeProvider' name.
CustomFlowbiteTheme
import type { CustomFlowbiteTheme } from 'flowbite-react';
TypeScript type for extending or customizing the default Flowbite theme.

This quickstart demonstrates the basic setup of a Flowbite React application, including how to initialize a project (using `npx create-flowbite-react@latest` implicitly), import and render core components like `Button` and `Modal`, manage component state, and apply a custom theme using the `Flowbite` context provider.

import { useState } from 'react'; import { Button, Modal, Flowbite } from 'flowbite-react'; import type { CustomFlowbiteTheme } from 'flowbite-react'; // Custom theme example for demonstration const customTheme: CustomFlowbiteTheme = { button: { base: 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800' }, modal: { content: { base: 'relative h-full w-full p-4 md:h-auto' } } }; function App() { const [openModal, setOpenModal] = useState(false); return ( <Flowbite theme={{ theme: customTheme }}> <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-white"> <h1 className="text-3xl font-bold mb-4">Welcome to Flowbite React!</h1> <Button onClick={() => setOpenModal(true)}>Show Modal</Button> <Modal show={openModal} onClose={() => setOpenModal(false)} popup> <Modal.Header>Terms of Service</Modal.Header> <Modal.Body> <div className="space-y-6"> <p className="text-base leading-relaxed text-gray-500 dark:text-gray-400"> With less than a month to go before the European Union enacts new consumer privacy laws, companies around the world are scrambling to update their data governance policies. </p> <p className="text-base leading-relaxed text-gray-500 dark:text-gray-400"> The European Union’s General Data Protection Regulation (GDPR) goes into effect on May 25, 2018, and is meant to ensure a common set of data rights in the European Union. </p> </div> </Modal.Body> <Modal.Footer> <Button onClick={() => setOpenModal(false)}>I accept</Button> <Button color="gray" onClick={() => setOpenModal(false)}> Decline </Button> </Modal.Footer> </Modal> </div> </Flowbite> ); } export default App;
Debug
Known issues
gotchaThe README explicitly states, '⚠️ This is a pre-release version - please note that APIs may change before the final release'. This indicates potential instability and breaking changes before a 1.0.0 release.
fix
Be prepared for potential API adjustments and breaking changes. Regularly review release notes when updating. Consider pinning to specific patch versions for stability in production environments.
affects: <1.0.0
breakingBreaking changes related to Tailwind CSS v4 integration. If using Tailwind CSS v4, the configuration now automatically generates a v4 config file and uses CSS variables instead of inline colors for theming. This change is only applicable if you are upgrading to Tailwind CSS v4.
fix
Review your Tailwind CSS configuration and component styling if upgrading to Tailwind CSS v4. Ensure your custom themes are compatible with the new CSS variable approach and update any direct color class usages if necessary. Run `npx flowbite-react@latest init` to ensure your project's configuration is up-to-date.
affects: >=0.12.11
gotchaThe recent bundle size reduction from 42 MB to 8.38 MB (flowbite-react@0.12.17) was achieved by dropping AST parsers in favor of `oxc-parser` and migrating the bundler from `tsup` to `tsdown`. While this is a positive change, it implies significant underlying build tool changes that could potentially expose new edge cases or build environment incompatibilities.
fix
Ensure your project's build environment and tooling are up-to-date. If encountering unexpected build issues after updating, check for specific compatibility notes related to `oxc-parser` or `tsdown` in the Flowbite React documentation or GitHub issues.
affects: >=0.12.17
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'tailwindConfig')
Flowbite React relies on a specific `tailwind.config.js` setup. This error often occurs when Tailwind CSS is not correctly configured or the `flowbite-react` plugin is missing from the config.
fix
Ensure `tailwind.config.js` exists and includes the `flowbite-react/plugin` in its plugins array. Run `npx flowbite-react@latest init` to automatically configure Tailwind CSS.
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
This typically means a component was imported incorrectly (e.g., trying to default import a named export) or the component path is wrong, leading to `undefined` being rendered where a React component is expected.
fix
Verify that you are using named imports (e.g., `import { Button } from 'flowbite-react';`) for all Flowbite React components. Double-check component names and import paths for typos.
Module not found: Error: Can't resolve 'flowbite-react'
The `flowbite-react` package is not installed or not correctly resolved by your module bundler.
fix
Ensure `flowbite-react` is listed in your `package.json` and installed (`npm install flowbite-react` or `yarn add flowbite-react`). Check your bundler configuration if it's a non-standard setup.
Upgrade
Version history
0.12.17latest on npm
Audit
Dependencies
reactrequiredPeer dependency for React applications.
react-domrequiredPeer dependency for rendering React components to the DOM.
tailwindcssrequiredPeer dependency for styling; Flowbite React components are styled with Tailwind CSS.
Agent activity
2 hits · last 30 days
node
2
Resources
flowbite-react — npm install flowbite-react · libregistry