Skip to content
Display

Collapsible

Animated show/hide for a single section.

Import

tsx
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@cronus-ui/ui";
bash
npx cronus-ui add collapsible

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component CollapsibleDefault layout:inline style:collapsible {
  label "Toggle"
  text "Hidden body"
}

page "/audit/collapsible/default" type:custom {
  use CollapsibleDefault
}

API Reference

Generated from the component's exported types.

CollapsibleProps

Extends ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>

Skip CollapsibleProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.
disabled
boolean—Disables pointer and keyboard interaction.

CollapsibleTriggerProps

Extends ComponentPropsWithoutRef< typeof CollapsiblePrimitive.CollapsibleTrigger >

Skip CollapsibleTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

CollapsibleContentProps

Extends ComponentPropsWithoutRef< typeof CollapsiblePrimitive.CollapsibleContent >

Skip CollapsibleContentProps props table
PropTypeDefaultDescription
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.