Convert Figma logo to code with AI

themesberg logoflowbite-react

Official React components built for Flowbite and Tailwind CSS

2,046
460
2,046
167

Top Related Projects

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

86,031

A set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks. Open Source. Open Code.

39,302

Chakra UI is a component system for building SaaS products with speed ⚡️

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

An enterprise-class UI design language and React UI library

Bootstrap components built with React

Quick Overview

Flowbite-React is an open-source library of React components and interactive elements built on top of the Tailwind CSS framework. It provides a set of customizable, accessible, and responsive UI components that can be easily integrated into React projects, allowing developers to create modern and visually appealing web applications quickly.

Pros

  • Extensive collection of pre-built, customizable React components
  • Seamless integration with Tailwind CSS for easy styling and customization
  • Accessible components that follow WCAG 2.1 guidelines
  • Active development and community support

Cons

  • Dependency on Tailwind CSS may limit flexibility for projects not using this framework
  • Learning curve for developers unfamiliar with Tailwind CSS
  • Some components may require additional customization for specific use cases

Code Examples

  1. Using a Button component:
import { Button } from 'flowbite-react';

function MyComponent() {
  return (
    <Button color="blue" onClick={() => console.log('Button clicked')}>
      Click me
    </Button>
  );
}
  1. Creating a simple form with TextInput and Checkbox:
import { TextInput, Checkbox, Label } from 'flowbite-react';

function LoginForm() {
  return (
    <form>
      <div>
        <Label htmlFor="email">Email</Label>
        <TextInput id="email" type="email" placeholder="name@example.com" required />
      </div>
      <div>
        <Checkbox id="remember" />
        <Label htmlFor="remember">Remember me</Label>
      </div>
    </form>
  );
}
  1. Implementing a responsive Navbar:
import { Navbar } from 'flowbite-react';

function Header() {
  return (
    <Navbar fluid rounded>
      <Navbar.Brand href="/">
        <img src="/logo.svg" className="mr-3 h-6 sm:h-9" alt="Logo" />
        <span className="self-center whitespace-nowrap text-xl font-semibold dark:text-white">
          My App
        </span>
      </Navbar.Brand>
      <Navbar.Toggle />
      <Navbar.Collapse>
        <Navbar.Link href="/" active>Home</Navbar.Link>
        <Navbar.Link href="/about">About</Navbar.Link>
        <Navbar.Link href="/contact">Contact</Navbar.Link>
      </Navbar.Collapse>
    </Navbar>
  );
}

Getting Started

To start using Flowbite-React in your project:

  1. Install the package:
npm install flowbite-react
  1. Make sure you have Tailwind CSS installed and configured in your project.

  2. Import and use Flowbite-React components in your React application:

import React from 'react';
import { Button } from 'flowbite-react';

function App() {
  return (
    <div>
      <h1>Welcome to My App</h1>
      <Button>Click me</Button>
    </div>
  );
}

export default App;

Competitor Comparisons

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Pros of Headless UI

  • More flexible and customizable, allowing for greater control over styling and behavior
  • Lighter weight, with a focus on core functionality without pre-styled components
  • Stronger TypeScript support and better type definitions

Cons of Headless UI

  • Requires more initial setup and styling work to create polished components
  • Less comprehensive documentation and fewer examples compared to Flowbite React
  • Steeper learning curve for developers new to headless UI concepts

Code Comparison

Headless UI (Menu component):

import { Menu } from '@headlessui/react'

function MyDropdown() {
  return (
    <Menu>
      <Menu.Button>Options</Menu.Button>
      <Menu.Items>
        <Menu.Item>
          {({ active }) => (
            <a className={`${active && 'bg-blue-500'}`} href="/account">
              Account
            </a>
          )}
        </Menu.Item>
        {/* More items... */}
      </Menu.Items>
    </Menu>
  )
}

Flowbite React (Dropdown component):

import { Dropdown } from 'flowbite-react';

function MyDropdown() {
  return (
    <Dropdown label="Dropdown button">
      <Dropdown.Item>Dashboard</Dropdown.Item>
      <Dropdown.Item>Settings</Dropdown.Item>
      <Dropdown.Item>Earnings</Dropdown.Item>
      <Dropdown.Item>Sign out</Dropdown.Item>
    </Dropdown>
  )
}
86,031

A set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks. Open Source. Open Code.

Pros of shadcn/ui

  • Highly customizable with a focus on flexibility and extensibility
  • Utilizes modern React patterns like hooks and composition
  • Offers a wider range of pre-built components and utilities

Cons of shadcn/ui

  • Steeper learning curve due to its more complex architecture
  • Less opinionated, which may require more setup and configuration
  • Smaller community and ecosystem compared to Flowbite

Code Comparison

shadcn/ui:

import { Button } from "@/components/ui/button"

export function Example() {
  return <Button variant="outline">Click me</Button>
}

Flowbite:

import { Button } from "flowbite-react"

export function Example() {
  return <Button outline>Click me</Button>
}

Both libraries offer similar component APIs, but shadcn/ui tends to provide more granular control over styling and behavior. Flowbite focuses on simplicity and ease of use, while shadcn/ui prioritizes customization and advanced features. The choice between them depends on project requirements, team expertise, and desired level of control over the UI components.

39,302

Chakra UI is a component system for building SaaS products with speed ⚡️

Pros of Chakra UI

  • More extensive component library with a wider range of pre-built components
  • Better accessibility features out of the box
  • Stronger community support and more frequent updates

Cons of Chakra UI

  • Steeper learning curve due to its more complex API
  • Larger bundle size, which may impact initial load times
  • Less opinionated styling, requiring more customization work

Code Comparison

Chakra UI:

import { Button, Box } from "@chakra-ui/react"

function Example() {
  return (
    <Box>
      <Button colorScheme="blue">Click me</Button>
    </Box>
  )
}

Flowbite React:

import { Button } from "flowbite-react"

function Example() {
  return (
    <div>
      <Button color="blue">Click me</Button>
    </div>
  )
}

Both libraries offer a similar component-based approach, but Chakra UI provides more built-in styling options and a more flexible theming system. Flowbite React, being based on Tailwind CSS, offers a more utility-first approach to styling. The choice between the two depends on project requirements, team preferences, and the desired level of customization.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Extensive component library with a wide range of UI elements
  • Strong community support and regular updates
  • Comprehensive documentation and examples

Cons of Material-UI

  • Steeper learning curve due to its complexity
  • Larger bundle size, which may impact performance
  • More opinionated design, which can be limiting for custom styles

Code Comparison

Material-UI:

import { Button } from '@mui/material';

<Button variant="contained" color="primary">
  Click me
</Button>

Flowbite React:

import { Button } from 'flowbite-react';

<Button color="blue">
  Click me
</Button>

Both libraries offer similar component-based approaches, but Material-UI provides more customization options out of the box. Flowbite React's syntax is generally simpler and more straightforward, making it easier for beginners to get started. However, Material-UI's extensive features and flexibility make it a powerful choice for complex projects.

An enterprise-class UI design language and React UI library

Pros of Ant Design

  • More comprehensive component library with a wider range of UI elements
  • Stronger ecosystem with extensive documentation and community support
  • Better internationalization support with built-in localization features

Cons of Ant Design

  • Larger bundle size, which may impact initial load times
  • Steeper learning curve due to its extensive API and customization options
  • Less flexibility in terms of design customization compared to Flowbite React

Code Comparison

Ant Design button example:

import { Button } from 'antd';

const MyComponent = () => (
  <Button type="primary">Click me</Button>
);

Flowbite React button example:

import { Button } from 'flowbite-react';

const MyComponent = () => (
  <Button color="blue">Click me</Button>
);

Both libraries offer similar basic functionality, but Ant Design provides more built-in variants and properties for components out of the box. Flowbite React, being based on Tailwind CSS, allows for more granular styling control through utility classes.

Bootstrap components built with React

Pros of React Bootstrap

  • More mature and established project with a larger community
  • Extensive documentation and examples
  • Wider range of components available out-of-the-box

Cons of React Bootstrap

  • Heavier bundle size due to its comprehensive nature
  • Less flexibility in customization compared to Flowbite React
  • Slower adoption of newer React features and patterns

Code Comparison

React Bootstrap:

import { Button } from 'react-bootstrap';

<Button variant="primary">Click me</Button>

Flowbite React:

import { Button } from 'flowbite-react';

<Button color="blue">Click me</Button>

Both libraries offer similar component APIs, but Flowbite React tends to use more modern React patterns and has a slightly simpler prop structure. React Bootstrap's extensive history means it has more comprehensive documentation and examples available, which can be beneficial for developers new to the library or React in general.

Flowbite React is built on top of Tailwind CSS, offering more flexibility in styling and customization. However, React Bootstrap's long-standing presence in the React ecosystem means it has a larger community and more third-party integrations available.

Ultimately, the choice between these libraries depends on project requirements, team familiarity, and desired customization level.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Flowbite React

⚠️ This is a pre-release version - please note that APIs may change before the final release

Build websites faster with components built on React and Tailwind CSS

Discord Total Downloads Latest release License


Flowbite React is an open-source collection of UI components built with React and Tailwind CSS utility classes that you can use as a starting point for your user interfaces and websites

Documentation

Browse the components at flowbite-react.com.

Learn more about Flowbite at Flowbite docs.

Getting started

Learn how to get started with Flowbite React and leverage the interactive React components built with Tailwind CSS.

Using the CLI

You can set up Flowbite React using the CLI in two ways:

1. Create a new project

Create a new Flowbite React application using popular React frameworks and technologies:

npx create-flowbite-react@latest

The CLI will prompt for the directory name, what template to use, and if it should initialize a new git repository.

For more details about how create-flowbite-react works, visit the package page.

2. Setup in an existing project

To add Flowbite React to an existing project, run:

npx flowbite-react@latest init

This will set up all necessary dependencies and configurations in your existing project.

Framework Integration Guides

Follow our official integration guides to set up Flowbite React with your preferred framework or technology stack:

Components

Note: Some components from the vanilla Flowbite library are not yet available in Flowbite React.

Accordion Alert Avatar
React Accordion React Alert React Avatar
Banner Badge Breadcrumb
React Banner React Badge React Breadcrumb
Button Button group Card
React Button React Button group React Card
Carousel Datepicker Dropdown
React Carousel React Datepicker React Dropdown
Footer Forms List group
React Footer React Forms React List group
Modal Navbar Pagination
React Modal React Navbar React Pagination
Progress bar Rating Sidebar
React Progress bar React Rating React Sidebar
Spinner Table Tabs
React Spinner React Table React Tabs
Tooltip Timeline Toast
React Tooltip React Timeline React Toast
Sticky Banner
React Banner

Community

Get help or discuss the library with the community:

⌨️ Discuss Flowbite on GitHub

For casual conversations with other users using the library:

💬 Join the Flowbite Discord Server

Contributing

We appreciate your interest in contributing! Please visit our guide on contributing to get started.

Figma

For access to the Figma design files for our components, visit:

🎨 Get access to the Figma design files

Copyright and license

The Flowbite name and logos are trademarks of Bergside Srl.

📝 Read about the licensing terms 📀 Brand guidelines and trademark usage agreement

NPM DownloadsLast 30 Days