Collapse
Expand or collapse a group of sections on demand.
Basic usage
Provide headers and content through items, and set the initial expanded panels with defaultActiveKey. Multiple panels can be expanded by default. disabled prevents toggling that header.
Examples
Accordion
Set accordion to allow at most one expanded panel; all panels can also be closed. For controlled state, use activeKey and onChange. The callback always returns string[], including in accordion mode.
Preserve or destroy content
Content mounts when first opened and remains mounted after closing by default. Enter a draft, close the panel and reopen it to continue editing. With destroyInactive, content unmounts after the closing animation, so internal uncontrolled values return to their initial state on reopening. Controlled state outside the panel remains application-owned.
Header actions
Use extra for an independent action beside the header. Extra buttons do not toggle the panel; this example only updates its read status.
API
Collapse API
Configuration for panel entries, expanded state and accordion mode.
CollapseItem
The title, content and state of a collapsible panel entry.