Skip to content
+

Collapsible

Collapsible is a component that shows or hides content.

CollapsibleContent API

Import

import * as Collapsible from '@base_ui/react/Collapsible';
const CollapsibleContent = Collapsible.Content;

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

htmlHidden'hidden'
| 'until-found'
'hidden'

The hidden state when closed

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use CollapsibleContent to change the default props of this component with the theme.

CollapsibleRoot API

Import

import * as Collapsible from '@base_ui/react/Collapsible';
const CollapsibleRoot = Collapsible.Root;

Props

Props of the native component are also available.

NameTypeDefaultDescription
animatedbooltrue

If true, the component supports CSS/JS-based animations and transitions.

classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

defaultOpenbooltrue

If true, the Collapsible is initially open. This is the uncontrolled counterpart of open.

disabledboolfalse

If true, the component is disabled.

onOpenChangefunc-

Callback fired when the Collapsible is opened or closed.

openbool-

If true, the Collapsible is initially open. This is the controlled counterpart of defaultOpen.

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use CollapsibleRoot to change the default props of this component with the theme.

CollapsibleTrigger API

Import

import * as Collapsible from '@base_ui/react/Collapsible';
const CollapsibleTrigger = Collapsible.Trigger;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use CollapsibleTrigger to change the default props of this component with the theme.