# collapse
**Repository Path**: mirrors_react-component/collapse
## Basic Information
- **Project Name**: collapse
- **Description**: React Collapse / Accordion
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-18
- **Last Updated**: 2025-06-12
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# rc-collapse
rc-collapse ui component for react
[![NPM version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/rc-collapse.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-collapse
[github-actions-image]: https://github.com/react-component/collapse/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/collapse/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/collapse/master.svg?style=flat-square
[codecov-url]: https://app.codecov.io/gh/react-component/collapse
[download-image]: https://img.shields.io/npm/dm/rc-collapse.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-collapse
## Live Demo
https://collapse-react-component.vercel.app
## Install
[](https://npmjs.org/package/rc-collapse)
## Usage
```js
var Collapse = require('rc-collapse');
var Panel = Collapse.Panel;
var React = require('react');
var ReactDOM = require('react-dom');
require('rc-collapse/assets/index.css');
var App = (
name | type | default | description |
---|---|---|---|
activeKey | String|Array |
The first panel key | current active Panel key |
className | String or object | custom className to apply | |
defaultActiveKey | String|Array |
null | default active key |
destroyOnHidden | Boolean | false | If destroy the panel which not active, default false. |
accordion | Boolean | false | accordion mode, default is null, is collapse mode |
onChange | Function(key) | noop | called when collapse Panel is changed |
expandIcon | (props: PanelProps) => ReactNode | specific the custom expand icon. | |
collapsible | 'header' | 'icon' | 'disabled' | - | specify whether the panel of children is collapsible or the area of collapsible. |
items | interface.ts#ItemType | - | collapse items content |
name | type | default | description |
---|---|---|---|
header | String or node | header content of Panel | |
headerClass | String | ' ' | custom className to apply to header |
showArrow | boolean | true | show arrow beside header |
className | String or object | custom className to apply | |
classNames | { header?: string, body?: string } | Semantic structure className | |
style | object | custom style | |
styles | { header?: React.CSSProperties, body?: React.CSSProperties } | Semantic structure styles | |
openMotion | object | set the animation of open behavior, [more](https://github.com/react-component/motion). Different with v2, closed pane use a `rc-collapse-content-hidden` class to set `display: none` for hidden. | |
forceRender | boolean | false | forced render of content in panel, not lazy render after clicking on header |
extra | String | ReactNode | Content to render in the right of the panel header | |
collapsible | 'header' | 'icon' | 'disabled' | - | specify whether the panel be collapsible or the area of collapsible. |