Jone

Collapsible

A high-quality, unstyled React collapsible component that displays a panel controlled by a button.

A collapsible panel controlled by a button.

Anatomy

Import the component and assemble its parts:

Anatomy
import { Collapsible } from '@base-ui/react/collapsible';

<Collapsible.Root>
  <Collapsible.Trigger />
  <Collapsible.Panel />
</Collapsible.Root>;

API reference

Root

NameTypeDefaultDescription
openOptionalboolean | undefinedWhether the collapsible panel is currently open. To render an uncontrolled collapsible, use the `defaultOpen` prop instead.
defaultOpenOptionalboolean | undefinedfalseWhether the collapsible panel is initially open. To render a controlled collapsible, use the `open` prop instead.
disabledOptionalboolean | undefinedfalseWhether the component should ignore user interaction.

Panel

NameTypeDefaultDescription
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 hidden. This prop is ignored when `hiddenUntilFound` is used.

On this page