Dinachi

Collapsible

An interactive component that expands and collapses a section of content.

#Installation

npx @dinachi/cli@latest add collapsible

#Usage

tsx
import { Collapsible, CollapsibleTrigger, CollapsiblePanel } from '@/components/ui/collapsible'

#Examples

Default Collapsible

A basic collapsible section

Controlled Collapsible

Collapsible with controlled open state and status display

State: Closed

#API Reference

PropTypeDefaultDescription
openbooleanThe controlled open state of the collapsible
defaultOpenbooleanfalseThe initial open state when uncontrolled
onOpenChange(open: boolean) => voidCallback fired when the open state changes
disabledbooleanfalseWhen true, prevents the user from interacting with the collapsible