Preview
Design guidance
Use Accordion when several related sections can open in place. Use Collapsible for one optional region owned by a surrounding surface.
| Need | Choose |
|---|---|
| Related sections | Accordion keeps several disclosures in one group. |
| One optional region | Collapsible opens a single region. |
Installation
Install the local ghost-kit source bundle while the registry runs at localhost:3110. It contains this component and its source dependencies. Prepare the local registry first so token dependencies also resolve locally.
Install
Basic usage
Structure
Examples
Multiple expansion
Keep more than one section open when people need to compare related details.
Disabled item
Keep unavailable information visible while preventing interaction with that item.
API reference
For inherited behavior and additional part properties, see the Base UI Accordion API.
| Prop | Type | Default | Description |
|---|---|---|---|
value | AccordionValue<Value> | The controlled value of the item(s) that should be expanded. To render an uncontrolled accordion, use the `defaultValue` prop instead. | |
defaultValue | AccordionValue<Value> | The uncontrolled value of the item(s) that should be initially expanded. To render a controlled accordion, use the `value` prop instead. | |
disabled | boolean | false | Whether the component should ignore user interaction. |
hiddenUntilFound | boolean | false | Allows the browser's built-in page search to find and expand the panel contents. Overrides the `keepMounted` prop and uses `hidden="until-found"` to hide the element without removing it from the DOM. |
keepMounted | boolean | false | Whether to keep the element in the DOM while the panel is closed. This prop is ignored when `hiddenUntilFound` is used. |
loopFocus | boolean | Deprecated following the [APG guidance update](https://github.com/w3c/aria-practices/pull/3434) to remove roving focus. This prop no longer affects keyboard focus behavior. | |
onValueChange | ((value: AccordionValue<Value>, eventDetails: AccordionRootChangeEventDetails) => void) | Event handler called when an accordion item is expanded or collapsed. Provides the new value as an argument. | |
multiple | boolean | false | Whether multiple items can be open at the same time. |
orientation | Orientation | 'vertical' | Deprecated following the [APG guidance update](https://github.com/w3c/aria-practices/pull/3434) to remove roving focus. This prop no longer affects keyboard focus behavior. |
className | string | ((state: Accordion.Root.State<Value>) => string) | CSS class applied to the element, or a function that returns a class based on the component's state. | |
render | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, Accordion.Root.State<Value>> | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. | |
style | React.CSSProperties | ((state: Accordion.Root.State<Value>) => React.CSSProperties) | Style applied to the element, or a function that returns a style object based on the component's state. |