Skip to Content
DocumentationCollapsible

Collapsible

An interactive component which expands/collapses a panel.

Examples

Default

Default open

This content starts visible because defaultOpen is set.

With animation (accordion)

With animation (fade)

API

Collapsible

PropertyTypePossible valuesDefaultDescription
openbooleantrue, false-Controls the open state (controlled).
defaultOpenbooleantrue, falsefalseWhether the content is open by default (uncontrolled).
onOpenChange(open: boolean) => void--Called when the open state changes.
animation”accordion” | “fade”accordion, fade-Type of animation to apply. When set, enables smooth expand/collapse animation. accordion animates the height (accordion-style), fade animates opacity. If not provided, no animation is applied.
…propsAll Radix Collapsible.Root props--All native properties of the Radix UI Collapsible Root component.

CollapsibleTrigger

PropertyTypePossible valuesDefaultDescription
asChildbooleantrue, falsefalseWhen true, uses the child element as the trigger.
disabledbooleantrue, falsefalseDisables the trigger interaction.
…propsAll Radix Collapsible.Trigger props--All native properties of the Radix UI Collapsible Trigger component.

CollapsibleContent

PropertyTypePossible valuesDefaultDescription
classNamestring--Additional CSS classes to apply to the content wrapper.
…propsAll Radix Collapsible.Content props--All native properties of the Radix UI Collapsible Content component.
Last updated on