# uxcore-collapse

> uxcore-collapse component for uxcore.

Latest version **2.2.0** (published 2018-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install uxcore-collapse
pnpm add uxcore-collapse
yarn add uxcore-collapse
bun add uxcore-collapse
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2018-09-27 |
| First published | 2015-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 35.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | vicent.bian |
| Maintainers | doubaozia, eternalsky, fengw, vincent.bian, xiaowuming, yeson |
| Keywords | react, react-component, uxcore-collapse, Collapse |

## Links

- npm: https://www.npmjs.com/package/uxcore-collapse
- Repository: https://github.com/uxcore/uxcore-collapse
- Homepage: https://github.com/uxcore/uxcore-collapse#readme
- Issues: http://github.com/uxcore/uxcore-collapse/issues
- npm.io page: https://npm.io/package/uxcore-collapse

## Dependencies (7)

- [lodash](https://npm.io/package/lodash.md) ^4.17.5
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) 15.x
- [css-animation](https://npm.io/package/css-animation.md) ^1.3.2
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.0
- [uxcore-animate](https://npm.io/package/uxcore-animate.md) ^0.2.0
- [react-lifecycles-compat](https://npm.io/package/react-lifecycles-compat.md) ^3.0.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2018-09-27
- 2.1.2 — 2018-06-22
- 2.1.1 — 2018-03-14
- 2.1.0 — 2018-02-28
- 2.0.1 — 2017-10-12
- 2.0.0 — 2017-08-15
- 1.5.0 — 2017-08-15
- 1.4.0 — 2017-08-09
- 1.3.1 — 2017-04-20
- 1.3.0 — 2017-04-06
- 1.2.0 — 2016-07-14
- 1.1.1 — 2016-03-07
- 1.1.0 — 2015-12-10
- 1.0.1 — 2015-11-10
- 1.0.0 — 2015-10-15

## README

---

## uxcore-collapse [![Dependency Status](http://img.shields.io/david/uxcore/uxcore-collapse.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-collapse) [![devDependency Status](http://img.shields.io/david/dev/uxcore/uxcore-collapse.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-collapse#info=devDependencies)

## TL;DR

uxcore-collapse ui component for react

#### Setup develop environment

```sh
$ git clone https://github.com/uxcore/uxcore-collapse && cd uxcore-collapse
$ npm install
$ npm start
```

## Usage

```js
<Collapse defaultActiveKey={["1"]} onChange={callback}>
    <Panel header={`This is panel header 1`} key="1">
        <p>{text}</p>
    </Panel>
    <Panel header={`This is panel header 2`} key="2">
        <p>{text}</p>
    </Panel>
    <Panel header={`This is panel header 3`} key="3">
        <p>{text}</p>
    </Panel>
</Collapse>
```

## Demo

[http://uxco.re/components/collapse/](http://uxco.re/components/collapse/)

## API

## Props
### Collapse

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
|---|---|---|---|---|
|prefixCls | string | optional | `kuma-collapse` | 默认类名，用户可以通过修改此项来完成样式的定制 |
|activeKey | array/string | optional | the first panel key  | 当前激活面板的 key 默认无，accordion 模式下默认第一个元素 |
|defaultActiveKey | array/string | optional | `null` | 初始化选中面板的 key |
|accordion | bool | optional | `false` | 手风琴模式 |
|onChange | function | optional | `(key，activeKey)=>{}` | 切换面板的回调，参数 key 为当前变动的面板，activeKey 为所有激活的面板 |

### Collapse.Panel

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
|---|---|---|---|---|
|key| string | optional | index | 当前面板的 key |
|prefixCls| string | optional | Collapse.prefixCls |默认类名，用户可以通过修改此项来完成样式的定制 |
|header | string/number/node | optional | `null`| 面板头内容 |
|isActive| bool | optional | false | 面板当前是否展开,true 表示展开 |
|onItemClick| function| optional | `(isActive, e)=>{}`| 面板头点击事件 |

---
_Source: https://npm.io/package/uxcore-collapse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
