Accordion

Create collapsible content sections with the Accordion and AccordionItem components

The Accordion component creates collapsible content sections, perfect for FAQs, expandable menus, or organizing large amounts of content.

Usage

Code
mdx
1<Accordion>
2 <AccordionItem title="First Question" defaultOpen>
3 This content is visible by default because of `defaultOpen`.
4 </AccordionItem>
5
6 <AccordionItem title="Second Question">
7 This content is collapsed by default.
8 </AccordionItem>
9</Accordion>

Live Example

An accordion is a UI pattern that allows users to expand and collapse sections of content. It's useful for organizing information in a compact, scannable format.

Props

Accordion

PropTypeDefaultDescription
childrenReactNoderequiredAccordionItem components to render
type"single" | "multiple""multiple"Whether one or multiple items can be open

AccordionItem

PropTypeDefaultDescription
titlestringrequiredThe clickable header text
childrenReactNoderequiredContent shown when expanded
defaultOpenbooleanfalseWhether the item starts expanded

Tips

Tip
Use the `defaultOpen` prop on the first AccordionItem to give users a preview of the content format.