Collapsible
A collapsible panel controlled by a button.
API reference
Import the component and place its parts the following way:
Anatomy
import { Collapsible } from '@base-ui-components/react/collapsible';
<Collapsible.Root>
<Collapsible.Trigger />
<Collapsible.Panel />
</Collapsible.Root>
Root
Prop | Type | Default | |
---|---|---|---|
className | string | (state) => string | undefined | |
defaultOpen | boolean | false | |
disabled | boolean | false | |
onOpenChange | (open) => void | undefined | |
open | boolean | 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 | |
---|---|---|
--collapsible-panel-height | number | |
--collapsible-panel-width | number |