Skip to content

Latest commit

 

History

History
42 lines (24 loc) · 1.57 KB

File metadata and controls

42 lines (24 loc) · 1.57 KB
title React Accordion - Flowbite
description Use the accordion component and its options to expand and collapse the content inside each panel based on state reactivity from React and Tailwind CSS

The accordion component from Flowbite React can be used to toggle the visibility of the content of each accordion panel tab by expanding the collapsing the trigger element based on multiple examples and styles.

The reactivity and state is handled by React and the components is built using the Tailwind CSS framework meaning that you can easily customize the styles and colors of the accordion.

To use the accordion component, you need to import the <Accordion> component from flowbite-react:

import { Accordion } from "flowbite-react";

Default accordion

Use this example of the <Accordion> component and the <AccordionPanel> and <AccordionTitle> subcomponents to create an accordion with multiple panels.

Collapse all

Use this example to automatically collapse all of the accordion panels by passing the collapseAll prop to the <Accordion> component.

With animation

Enable smooth open/close animation by passing animate and animationDuration (in milliseconds) to the <Accordion> component.

Theme

To learn more about how to customize the appearance of components, please see the Theme docs.

References