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

Reduce motion:Off
Tune:Off
Inspect

Installation

Basic usage

TypeScript
faq.tsx

Examples

Multiple open items

Set allowMultiple when people should be able to compare more than one section at a time.

TypeScript
multiple-items.tsx

Variants

Choose default, outlined, splitted, or animated to match the density and separation of the surrounding layout.

Usage

API

PropertyTypeDefaultDescription
childrenReactNoderequiredThe accordion items.
allowMultiplebooleanfalseAllows multiple accordion items to be open simultaneously.
valuestring[]—Controlled values of the currently open items.
defaultValuestring[]—Values of the initially open items for uncontrolled usage.
onValueChangeAccordion.Root.Props<string>["onValueChange"]—Called when the set of open item values changes.
disabledbooleanfalseWhether the entire accordion ignores interaction.
keepMountedbooleanfalseKeeps closed panels mounted in the DOM.
hiddenUntilFoundbooleanfalseAllows browser find-in-page to reveal matching panel content.
classNamestring—Additional classes for the accordion root.
variantAccordionVariant"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.

Related components