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
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
defaultValue | array | undefined | |
disabled | boolean | false | |
hiddenUntilFound | boolean | false | |
keepMounted | boolean | false | |
loop | boolean | true | |
onValueChange | (value) => void | undefined | |
openMultiple | boolean | true | |
orientation | 'horizontal' | 'vertical' | 'vertical' | |
render | | React.ReactElement | undefined | |
value | array | undefined |
Item
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
disabled | boolean | false | |
onOpenChange | (open) => void | undefined | |
render | | React.ReactElement | undefined |
Header
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
render | | React.ReactElement | undefined |
Trigger
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
render | | React.ReactElement | undefined |
Panel
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
hiddenUntilFound | boolean | false | |
keepMounted | boolean | false | |
render | | React.ReactElement | undefined |
CSS Variable | Type | |
---|---|---|
--accordion-panel-height | number | |
--accordion-panel-width | number |