Skip to content

Accordion

An accordion is a vertically stacked set of headers that toggle associated content. Use it for FAQs, settings, and other dense information.

Loading Code Block...

The example below uses the default type with collapsible behaviour, optional button groups, and mixed header patterns.

Loading Code Block...

The simplest accordion with collapsible items. Each item needs a unique id, a .

Loading Code Block...

Control whether only one item can be open at a time (collapse) or multiple items can stay open simultaneously (always-open).

When one item is opened, any previously open item automatically closes. Items with isActive: true will be open on initial mount.

Loading Code Block...

Multiple items can be expanded at the same time. Users can toggle each item independently without affecting others.

Loading Code Block...

The default type renders a clean, minimal accordion suited for dashboards and application panels. Content area has a scrollable max-height (max-h-[300px] on mobile, max-h-[350px] on desktop).

Loading Code Block...

The website type adds a bold border and shadow effect (border-2 border-black shadow-[0px_6px_0px_0px]) when an item is open, giving it a striking, editorial look ideal for marketing and landing pages. Button groups are not rendered in website mode, and content is not scrollable.

Loading Code Block...

You can fully customise the header of each accordion item.

Loading Code Block...

Each accordion item can include action buttons at the bottom of its content area using buttonGroupProps. This integrates with the ButtonGroup component and supports primary, secondary, and tertiary buttons.

Loading Code Block...

Use itemClassName to apply custom CSS classes to accordion items. It can be a static string or a function that receives the isOpen state for dynamic styling. Per-item itemClassName overrides the group-level value.

Loading Code Block...

Set isActive: true on any item to have it expanded by default when the accordion first renders. In collapse mode, only the first active item will be shown. In always-open mode, all active items will be expanded.

Loading Code Block...

The header trigger is keyboard-accessible and toggles on Enter or Space, and the hidden content is marked with aria-hidden while collapsed.

Both implementations expose the same role and announcements to assistive tech.