Skip to content
SevenUI
Sign in
On this page

Collapsible

An interactive primitive which expands/collapses a panel, built on the Base UI Collapsible.

@owuzan starred 3 repositories

shadcn-ui/ui

Installation

Bash

Usage

Examples

File tree

Nested collapsibles with the open state styled through data-panel-open on the trigger (the rotating chevron).

index.ts
package.json
README.md

API reference

Collapsible

Extends the Base UI Collapsible Root (a <div>).

PropTypeDefault
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
disabledbooleanfalse

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.

PropTypeDefault
keepMountedbooleanfalse
hiddenUntilFoundbooleanfalse

Was this page helpful?