Collapsible
Expandable region with animated panel.
Installation
Usage
Examples
Open by default
Pass defaultOpen to render the panel expanded on first paint.
Disabled
Pass disabled to lock the panel shut.
API reference
Collapsible
| Prop | Type | Default |
|---|---|---|
openControlled open state. Use with onOpenChange. | boolean | - |
defaultOpenInitially open panel (uncontrolled). | boolean | false |
onOpenChangeCalled when the panel is opened or closed. | (open: boolean) => void | - |
disabledIgnore user interaction across the whole collapsible. | boolean | false |
CollapsibleTrigger
| Prop | Type | Default |
|---|---|---|
renderRender a custom trigger element, e.g. render={<Button>Edit</Button>}. | ReactElement | ((props) => ReactNode) | - |
disabledDisable the trigger. | boolean | false |
CollapsibleContent
| Prop | Type | Default |
|---|---|---|
keepMountedKeep panel content in the DOM while closed. | boolean | false |
hiddenUntilFoundHide the closed panel with hidden="until-found" so browser find can expand it. | boolean | false |
classNameAdditional classes merged with the default panel styles. | string | - |