Skip to content

Collapsible

A disclosure panel that opens with its content's height.

Show more

Release 4.2

Shipped on Tuesday with no open issues.

Open by default

Payment details
Invoice
INV-0412
Due
30 November
Amount
1,240.00

Disabled

Archived tasks

Without the height animation

Keyboard shortcuts

Installation

npx shadcn@latest add @khaeli/collapsible

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • @base-ui/react ^1.7.0

Keyboard

EnterSpace
Opens or closes the panel from the trigger.
Tab
Moves to the trigger, then into the open panel. With disabled on the root the trigger is a native disabled button and is skipped.

Accessible name

  • The trigger is a button named by its text and exposes aria-expanded. Say what it shows, and change the text when it changes what it does: Show 3 changes, Hide changes.
  • An icon-only trigger needs an aria-label that names what it opens. Do not put the state in the label: aria-expanded already says it.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/collapsible.json