Collapsible

A section that shows and hides its content with a height animation.

@cupertinoui/collapsibleBase UI Collapsible Registry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/collapsible

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"

<Collapsible defaultOpen>
  <CollapsibleTrigger>Favorites</CollapsibleTrigger>
  <CollapsibleContent>…</CollapsibleContent>
</Collapsible>

API Reference

Every part forwards the props of the underlying Base UI Collapsible part. The props below are the ones CupertinoUI adds or changes.

Collapsible

PropTypeDescription
open / defaultOpen / onOpenChangeWhether the content shows.
classNamestringExtra classes, merged with the component's own.