# uxcore-checkbox-group

> uxcore-checkbox-group component for uxcore.

Latest version **1.4.6** (published 2018-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install uxcore-checkbox-group
pnpm add uxcore-checkbox-group
yarn add uxcore-checkbox-group
bun add uxcore-checkbox-group
```

## 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 | 1.4.6 |
| Published | 2018-10-31 |
| First published | 2015-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 28 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | eternalsky |
| Maintainers | eternalsky, kewenlei, qingniao99, surfacew |
| Keywords | react, react-component, uxcore-checkbox-group, CheckboxGroup |

## Links

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

## Dependencies (4)

- [kuma-base](https://npm.io/package/kuma-base.md) 1.x
- [classnames](https://npm.io/package/classnames.md) ^2.1.2
- [prop-types](https://npm.io/package/prop-types.md) 15.x
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.0

## 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

- 1.4.6 (latest) — 2018-10-31
- 1.4.2 — 2018-10-31
- 1.4.5 — 2018-09-26
- 1.4.1 — 2018-08-27
- 1.4.0 — 2018-08-16
- 1.3.0 — 2018-05-09
- 1.2.4 — 2018-03-30
- 1.2.3 — 2017-11-01
- 1.2.2 — 2017-10-13
- 1.2.1 — 2017-09-26
- 1.2.0 — 2017-09-19
- 1.1.4 — 2017-02-25
- 1.1.3 — 2017-02-25
- 1.1.2 — 2016-12-15
- 1.1.1 — 2016-05-20
- … 13 more at https://npm.io/package/uxcore-checkbox-group/versions

## README

---

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

## TL;DR

uxcore-checkbox-group ui component for react
ES5 support needed(like es5-shim)

#### setup develop environment

```sh
$ git clone https://github.com/uxcore/uxcore-checkbox-group
$ cd uxcore-checkbox-group
$ npm install
$ gulp server
```

## Usage

```javascript
let classnames = require('classnames');

let CheckboxGroup = require('../src');
let Item = CheckboxGroup.Item

class Demo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            value: ["air"]
        }
    }

    handleChange(value) {
        this.setState({
            value: value
        })
    }

    render() {
        return (
            <div>
                <CheckboxGroup onChange={this.handleChange.bind(this)} value={this.state.value}>
                    <Item text="天空天空天空" value="air"
                        addon={
                        <Popover overlay={<div>提示</div>}>
                            <i className='kuma-icon kuma-icon-caution' style={{color: 'blue', fontSize: '12px', 'marginLeft': '3px'}} />
                        </Popover>
                        }
                    />
                    <Item text="<b>大海大海大海</b>" value="sea"/>
                    <Item text="陆地陆地陆地" value="land"/>
                    <Item text="飞机飞机飞机" value="plane"/>
                    <Item text="火车飞机飞机" value="train"/>

                </CheckboxGroup>
            </div>
        );
    }
};

module.exports = Demo;
```

## demo
http://uxcore.github.io/

## API

## Props

### CheckboxGroup

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
|---|---|---|---|---|
|value|array|required|[]|由 value 组成地数组，与 React 受限组件表现一致，选中项与 value 保持一致，数组中的值与 item 的 value 相对应|
|onChange|function|required|-|与 React 受限组件表现一致，在 checkbox 群发生改变时触发，借此来更改 value|
|disabled|boolean|optional|false|是否为 disable 状态|

### CheckboxItem

> 通过 CheckboxGroup.Item 取得。

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
|---|---|---|---|---|
|text|string|optinal|-|checkbox 后面跟着的说明文字|
|value|string|required|-|checkbox 对应的值|
|disabled|boolean|optional|-|Item 是否为 disable 状态，具有比 Group 更高的优先级|
|addons|jsx|optional|-|显示在label后面的添加项，可以用作checkbox的tips|

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