Collapsible pane

Pane section with expand/collapse toggle. Built on Radix Collapsible with animated height transitions.

Install

npx shadcn@latest add https://substrate.georgedrury.co.uk/r/collapsible-pane

Examples

Default

The first section starts open, the second starts collapsed. Click the chevron to toggle.

Transform
X
Y
Appearance
"use client"

import { useState } from "react"

Components

ComponentDescription
CollapsiblePaneRoot wrapper with Radix Collapsible state
CollapsiblePaneHeaderHeader row with expand/collapse chevron
CollapsiblePaneLabelSection title text
CollapsiblePaneContentAnimated body that collapses to zero height

Props (CollapsiblePane)

PropTypeDefaultDescription
defaultOpenbooleantrueInitial open state (uncontrolled)
openboolean—Controlled open state
onOpenChange(open: boolean) => void—Called when open state changes