‮Skip to content‬
uiify

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

‮Prop‬‮Type‬‮Default‬‮Description‬
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.‬
defaultOpenbooleanfalse‮Open on first render. Uncontrolled, so it survives with no JavaScript.‬
disabledbooleanfalse‮Blocks toggling and marks the summary with aria-disabled and data-disabled.‬
classNamestring—‮Class applied to the <details> root.‬

‮Keyboard‬

‮Key‬‮Action‬
Tab‮Move focus to/from the control‬
Enter / Space‮Activate 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