Skip to content

Collapsible

Region that the user can show or hide.

Browsers
Chrome 123+Firefox 121+Safari 17.5+
Tier
0
Bundle compressed
429 B
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Built on
elements/details
Published contract
Test harness

Playground

Collapsible

Closed

Toggle section
Hidden panel content

Open

Toggle section
Visible panel content

API

Collapsible

PropTypeDefaultDescription
id*string—Id of the underlying <details> element.
label*ReactNode—Content of the summary that opens and closes the region.
content*ReactNode—Content of the panel revealed when the region is open.
defaultOpenbooleanfalseOpen on first render. Uncontrolled, so it survives with no JavaScript.
disabledbooleanfalseBlocks toggling and marks the summary with aria-disabled and data-disabled.
classNamestring—Class applied to the <details> root.

Keyboard

KeyAction
TabMove focus to/from the control
Enter / SpaceActivate when focused (button-like controls)

Accessibility

Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.

Styling hooks

data-disabled