Accordion

A set of collapsible panels with headings.

API reference

Import the component and place its parts the following way:

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

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

Root

PropTypeDefault
classNamestring | (state) => stringundefined
defaultValuearrayundefined
disabledbooleanfalse
hiddenUntilFoundbooleanfalse
keepMountedbooleanfalse
loopbooleantrue
onValueChange(value) => voidundefined
openMultiplebooleantrue
orientation'horizontal' | 'vertical''vertical'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
valuearrayundefined

Item

PropTypeDefault
classNamestring | (state) => stringundefined
disabledbooleanfalse
onOpenChange(open) => voidundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Trigger

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Panel

PropTypeDefault
classNamestring | (state) => stringundefined
hiddenUntilFoundbooleanfalse
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
CSS VariableType
--accordion-panel-heightnumber
--accordion-panel-widthnumber