Accordion
An accordion is a vertically stacked list of headers that can be clicked to reveal or hide associated content. It allows users to toggle between hiding and showing large amounts of content in a compact space.
Accordions are useful when you want to toggle between hiding and showing large amounts of content. They help reduce vertical space and improve the user experience by organizing content in a hierarchical, easy-to-scan way.
Basic Accordion
A basic accordion with multiple panels that can be expanded and collapsed independently.
This is the content for the first accordion panel. You can add any content here, including text, images, or other components.
This is the content for the second accordion panel. Accordions can contain rich content and media.
Controlled Accordion
A controlled accordion where only one panel can be expanded at a time, providing a more focused user experience.
Controlled accordions manage their expanded state through React, allowing only one panel to be open at a time. This creates a cleaner, more focused user experience by preventing multiple sections from being visible simultaneously.
When expanding this panel, the previously opened panel automatically collapses. This behavior is ideal for settings pages, configuration panels, and any interface where you want users to focus on one section at a time.
Accordions help organize complex information into digestible sections. They reduce cognitive load by hiding content until users actively choose to reveal it, making interfaces feel less overwhelming and more navigable.