Collapsible
An interactive primitive which expands/collapses a panel, built on the Base UI Collapsible.
@owuzan starred 3 repositories
Installation
Bash
Usage
Examples
File tree
Nested collapsibles with the open state styled through
data-panel-open on the trigger (the rotating chevron).
API reference
Collapsible
Extends the
Base UI Collapsible
Root (a <div>).
| Prop | Type | Default |
|---|---|---|
open / defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
disabled | boolean | false |
CollapsibleTrigger
Open state styles via data-panel-open (presence). A disabled trigger
stays focusable with aria-disabled="true" — style it with
data-disabled:, not disabled:.
CollapsibleContent
Closed content unmounts by default. keepMounted and hiddenUntilFound
are Panel props here (unlike Accordion, where they live on the
Root) — pass them through this primitive. Open/close animates via the
animate-collapsible-down / animate-collapsible-up utilities, whose
keyframes (driven by the Base UI-set --collapsible-panel-height
variable) ship in this primitive’s registry item — the CLI merges them
into your CSS, same as the accordion’s.
| Prop | Type | Default |
|---|---|---|
keepMounted | boolean | false |
hiddenUntilFound | boolean | false |