Accordion
Use Accordion when a short list of related sections needs to expand in place. It supports one or many open items, controlled state, and four visual variants.
Preview
Installation
Basic usage
Examples
Multiple open items
Set allowMultiple when people should be able to compare more than one section at a time.
Variants
Choose default, outlined, splitted, or animated to match the density and separation of the surrounding layout.
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
children | ReactNode | required | The accordion items. |
allowMultiple | boolean | false | Allows multiple accordion items to be open simultaneously. |
value | string[] | — | Controlled values of the currently open items. |
defaultValue | string[] | — | Values of the initially open items for uncontrolled usage. |
onValueChange | Accordion.Root.Props<string>["onValueChange"] | — | Called when the set of open item values changes. |
disabled | boolean | false | Whether the entire accordion ignores interaction. |
keepMounted | boolean | false | Keeps closed panels mounted in the DOM. |
hiddenUntilFound | boolean | false | Allows browser find-in-page to reveal matching panel content. |
className | string | — | Additional classes for the accordion root. |
variant | AccordionVariant | "default" | Visual style of the accordion. |
Accessibility
Accordion uses Base UI disclosure semantics with connected triggers and panels. Triggers can be reached by keyboard and expose their expanded state. Keep each trigger label specific enough to describe the panel it reveals.
Styling
Use the root variant and class name options to adapt spacing and surfaces to the surrounding page. The panel transition respects reduced-motion preferences.
Contact
Found a bug or need help using this component? Open an issue on GitHub.
License & Usage
Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.
Was this page helpful?
Your response helps us improve component docs.