Jone

Accordion

A high-quality, unstyled React accordion component that displays a set of collapsible panels with headings.

A set of collapsible panels with headings.

Anatomy

Import the component and assemble its parts:

Anatomy
import { Accordion } from '@base-ui/react/accordion';

<Accordion.Root>
  <Accordion.Item>
    <Accordion.Header>
      <Accordion.Trigger />
    </Accordion.Header>
    <Accordion.Panel />
  </Accordion.Item>
</Accordion.Root>;

Examples

Open multiple panels

You can set up the accordion to allow multiple panels to be open at the same time using the multiple prop.

API reference

Root

NameTypeDefaultDescription
valueOptionalAccordionValue<Value> | undefinedThe controlled value of the item(s) that should be expanded. To render an uncontrolled accordion, use the `defaultValue` prop instead.
defaultValueOptionalAccordionValue<Value> | undefinedThe uncontrolled value of the item(s) that should be initially expanded. To render a controlled accordion, use the `value` prop instead.
disabledOptionalboolean | undefinedfalseWhether the component should ignore user interaction.
hiddenUntilFoundOptionalboolean | undefinedfalseAllows 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.
keepMountedOptionalboolean | undefinedfalseWhether to keep the element in the DOM while the panel is closed. This prop is ignored when `hiddenUntilFound` is used.
loopFocusOptionalboolean | undefinedtrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
multipleOptionalboolean | undefinedfalseWhether multiple items can be open at the same time.
orientationOptionalOrientation | undefinedverticalThe visual orientation of the accordion. Controls whether roving focus uses left/right or up/down arrow keys.

On this page