Accordion

Collapsible content sections with smooth animations.

Is it accessible?

Yes. It adheres to the WAI-ARIA design pattern.

Is it styled?

Yes. It comes with default styles that match the other components.

Is it animated?

Yes. It's animated by default, but you can disable it if you prefer.

Examples

Multiple Items

First section

Content for the first section.

Second section

Content for the second section.

Third section

Content for the third section.

With Default Value

Section 1

Content for section 1.

Section 2 (open by default)

This section is open by default using the defaultValue prop.

Section 3

Content for section 3.

API Reference

PropTypeDefaultDescription
type'single' | 'multiple''single'Determines whether one or multiple items can be opened at the same time.
defaultValuestring | string[]undefinedThe value of the item(s) to expand by default.
valuestring | string[]undefinedThe controlled value of the item(s) to expand.
onValueChange(value: string | string[]) => voidundefinedEvent handler called when the expanded state changes.
collapsiblebooleanfalseWhen true, allows closing content by clicking the trigger for an open item.