Collapsible
A single show/hide disclosure. Use it for one optional region; for a set of them use Accordion.
Purpose
Use a Collapsible to tuck one optional region behind a trigger — advanced filters, secondary detail, a long note — so the common path stays uncluttered. It is the single-disclosure primitive: for a stack of sections use Accordion, which adds the exclusive-open behaviour and its own styling.
Collapsible ships completely unstyled. It contributes the open/closed mechanics and the ARIA
wiring; the trigger is whatever you compose — usually a Button via
asChild.
Disclosure
Collapsed by default; the trigger toggles it.
States
Two states: closed (the default) and open. Start open with defaultOpen when the content is
usually wanted — for instance notes already attached to the record.
Member submitted a duplicate receipt; original approved on 21 July 2026.
Control it yourself when something else needs to react to the state — for example swapping the chevron:
const [open, setOpen] = React.useState(false);
<Collapsible open={open} onOpenChange={setOpen}>
<CollapsibleTrigger asChild>
<Button variant="outline">
Advanced filters
<Glyph symbol={open ? "expand_less" : "expand_more"} size={18} />
</Button>
</CollapsibleTrigger>
<CollapsibleContent>…</CollapsibleContent>
</Collapsible>Structure
Collapsible has no tokens of its own — it renders no visual styling. What it does provide:
| Part | What you get |
|---|---|
Collapsible | State container; open / defaultOpen / onOpenChange / disabled |
CollapsibleTrigger | A button (compose your own with asChild); toggles on activation |
CollapsibleContent | Removed from the DOM while closed (unless forceMount) |
| Styling hook | data-state="open" / "closed" on all three parts |
Best practices
Do
- Label the trigger with what it reveals — "Advanced filters", not "More".
- Signal the state on the trigger, e.g. a chevron that flips with
data-stateor controlled state. - Keep the default collapsed when the content is genuinely optional.
- Use
defaultOpenwhen most visits need the content — do not make people earn it.
Don't
- Hide required form fields inside one — validation errors in a closed region go unseen.
- Stack several Collapsibles to fake an Accordion — use the real one.
- Put the page's primary content behind a disclosure.
- Nest disclosures more than one level deep.
Accessibility & keyboard
- The trigger carries
aria-expandedandaria-controls, wired by Radix — screen readers hear the state without any extra work. - Closed content is removed from the DOM, so nothing hidden is tab-reachable or announced.
- Keyboard: Tab to the trigger; Enter or Space toggles.
- A
disabledroot disables the trigger; it stays visible at 50% opacity via your composed button.
Props
All three parts are re-exports of the Radix Collapsible primitives, unmodified — Collapsible
takes open, defaultOpen, onOpenChange and disabled; the trigger and content take
asChild plus native attributes. There is no separate props interface to document.
Every Collapsible part and prop in Storybook
Menubar
A horizontal application menu bar. Rare in the product UI; it exists for dense internal tools that expect desktop conventions.
Dialog
A modal window for a focused task — editing a record, previewing a document, a short form. It traps focus, returns it to the trigger on close, and can be dismissed by overlay click, Esc or the × button.