Collapsible

An interactive section that expands and collapses to reveal additional content.

Squads include a dedicated team of designers, a project manager, and a senior creative director — all working together on your brand.

Installation
$Terminal
npx shadcn@latest add https://sdk-components.thesqd.com/r/collapsible.json
Usage
Import the flat CollapsibleSection wrapper for the common case, or drop down to the primitives for full control.
TSImport
import { CollapsibleSection } from "@/components/ui/collapsible";
TSExample
import { CollapsibleSection } from "@/components/ui/collapsible";

export function Example() {
  return (
    <CollapsibleSection
      variant="default"
      title="What's included in the squad?"
      description="Click to expand and read the details."
      defaultOpen
    >
      <p className="pt-2 text-muted-foreground">
        Squads include a dedicated team of designers, a project manager, and a
        senior creative director — all working together on your brand.
      </p>
    </CollapsibleSection>
  );
}
Composition
Anatomy of CollapsibleSection and the underlying primitives.
CollapsibleSection                 (flat one-liner — pass everything as props)
├── variant="default | outline | ghost"
├── size="sm | default | lg"
├── title={<ReactNode>}              (heading row, required)
├── description={<ReactNode>}        (muted secondary line, optional)
├── icon={<ReactNode>}                (override the chevron, optional)
├── defaultOpen / open / onOpenChange (uncontrolled or controlled)
├── disabled?: boolean
└── children                         (body content)

— or use the primitives directly —

Collapsible                          (Base UI Collapsible.Root with data-slot)
├── CollapsibleTrigger               (button that toggles the panel)
└── CollapsibleContent               (animated panel; uses --collapsible-panel-height)
Default
Bordered card surface with a chevron indicator that rotates when open.

Squads include a dedicated team of designers, a project manager, and a senior creative director — all working together on your brand.

Outline
Outlined variant for lighter surfaces.
Ghost
No border, hover-only background — slots into dense forms.
Controlled
Lift the open state into your component with open / onOpenChange.
State:closed
Nested
A CollapsibleSection inside another CollapsibleSection.

Manage profile, billing, and team settings.

Primitives
Drop down to Collapsible / CollapsibleTrigger / CollapsibleContent for full control.
@thesqd/squad-ui starred 3 repositories
@sis-thesqd/squad-ui
@sis-thesqd/squad-sdk
@sis-thesqd/dynamic-forms-squad-sdk
API Reference
Props for the flat CollapsibleSection wrapper and the underlying primitives.

CollapsibleSection

PropTypeDefaultDescription
titleReactNodeHeading rendered in the trigger row.
descriptionReactNodeOptional muted secondary line below the title.
variant"default" | "outline" | "ghost""default"Surface treatment — bordered card, outline, or ghost.
size"sm" | "default" | "lg""default"Padding scale applied to the trigger row and body.
iconReactNodeIndicator icon. Defaults to ChevronDown that rotates 180° when open.
hideIconbooleanfalseHide the indicator icon entirely.
defaultOpenbooleanfalseInitial open state when uncontrolled.
openbooleanControlled open state. Pair with onOpenChange.
onOpenChange(open: boolean) => voidFires when the user toggles the section.
disabledbooleanfalseDisable the trigger and grey out the section.
childrenReactNodeBody content rendered inside the animated panel.

Primitives

PropTypeDefaultDescription
CollapsibleBase UI Collapsible.RootRoot container. Accepts open / defaultOpen / onOpenChange / disabled.
CollapsibleTriggerBase UI Collapsible.TriggerButton that toggles the panel. Use render={<Button … />} to swap the element.
CollapsibleContentBase UI Collapsible.PanelAnimated panel. Reads --collapsible-panel-height for height transitions.