2016-07-04 10:51:50 +08:00
---
category: Components
2016-11-09 14:43:32 +08:00
type: Data Display
2016-07-04 10:51:50 +08:00
title: Collapse
2016-11-06 15:06:34 +08:00
cols: 1
2020-05-31 11:48:34 +08:00
cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
2016-07-04 10:51:50 +08:00
---
A content area which can be collapsed and expanded.
2016-09-10 13:43:30 +08:00
## When To Use
2016-07-04 10:51:50 +08:00
- Can be used to group or hide complex regions to keep the page clean.
- `Accordion` is a special kind of `Collapse` , which allows only one panel to be expanded at a time.
## API
### Collapse
2019-05-06 12:04:39 +08:00
| Property | Description | Type | Default | Version |
2019-05-07 14:57:32 +08:00
| --- | --- | --- | --- | --- |
2020-10-21 10:33:43 +08:00
| accordion | If true, Collapse renders as Accordion | boolean | false | |
2020-07-01 22:15:26 +08:00
| activeKey | Key of the active panel | string\[] \| string < br /> number\[] \| number | No default value. In `accordion` mode, it's the key of the first panel | |
2020-06-17 23:18:14 +08:00
| bordered | Toggles rendering of the border around the collapse block | boolean | true | |
2022-09-20 19:32:18 +08:00
| collapsible | Specify whether the panels of children be collapsible or the trigger area of collapsible | `header` \| `icon` \| `disabled` | - | 4.9.0 |
2020-10-21 10:33:43 +08:00
| defaultActiveKey | Key of the initial active panel | string\[] \| string < br /> number\[] \| number | - | |
| destroyInactivePanel | Destroy Inactive Panel | boolean | false | |
2020-07-01 22:15:26 +08:00
| expandIcon | Allow to customize collapse icon | (panelProps) => ReactNode | - | |
2022-05-27 16:07:32 +08:00
| expandIconPosition | Set expand icon position | `start` \| `end` | - | 4.21.0 |
2020-07-01 22:15:26 +08:00
| ghost | Make the collapse borderless and its background transparent | boolean | false | 4.4.0 |
2020-10-21 10:33:43 +08:00
| onChange | Callback function executed when active panel is changed | function | - | |
2016-07-04 10:51:50 +08:00
### Collapse.Panel
2019-07-11 14:14:33 +08:00
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
2022-09-20 19:32:18 +08:00
| collapsible | Specify whether the panel be collapsible or the trigger area of collapsible | `header` \| `icon` \| `disabled` | - | 4.9.0 (icon: 4.24.0) |
2020-10-21 10:33:43 +08:00
| extra | The extra element in the corner | ReactNode | - | |
2022-05-24 22:33:22 +08:00
| forceRender | Forced render of content on panel, instead of lazy rendering after clicking on header | boolean | false | |
2020-10-09 10:08:52 +08:00
| header | Title of the panel | ReactNode | - | |
2020-07-01 22:15:26 +08:00
| key | Unique key identifying the panel from among its siblings | string \| number | - | |
2022-09-20 19:32:18 +08:00
| showArrow | If false, panel will not show arrow icon. If false, collapsible can't be set as icon | boolean | true | |