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

PropTypeDefault
classNamestring | (state) => stringundefined
defaultOpenbooleanfalse
disabledbooleanfalse
onOpenChange(open) => voidundefined
openbooleanundefined

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
--collapsible-panel-heightnumber
--collapsible-panel-widthnumber