Accordion Component
A vertically stacked, collapsible content container. Each panel pairs a header with a content region, with single- or multi-open behavior and controlled and uncontrolled value support.
Usage
To import and use the Accordion component in your application, use the following code snippet:
Demos
Explore the demos of the React Accordion component. Refer to this page.
Props
The following table outlines the props for the Accordion component:
| Name | Type | Default | Description |
|---|---|---|---|
| borderless | boolean | false | Specifies whether the accordion is rendered without visible borders. |
| defaultValue | Array<string | number> | - | Specifies the default value of active panels. |
| multiple | boolean | false | Specifies whether multiple items can be active together. |
| openOnFocus | boolean | false | Specifies whether focusing a header opens the panel content. |
| renderMode | RenderMode.Active | Specifies the panel mount strategy. | |
| value | Array<string | number> | - | Specifies the active panel values. |
Events
The following table outlines the events for the Accordion component:
| Name | Type | Description |
|---|---|---|
| onChange | (event: AccordionChangeEvent) => void | Specifies the callback fired when the value changes. |