# @jswork/react-ant-checkbox-group

> React ant checkbox group.

Latest version **1.0.5** (published 2021-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jswork/react-ant-checkbox-group
pnpm add @jswork/react-ant-checkbox-group
yarn add @jswork/react-ant-checkbox-group
bun add @jswork/react-ant-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.0.5 |
| Published | 2021-09-14 |
| First published | 2021-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 30.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | afei |
| Maintainers | afeiship |
| Keywords | react, ant, checkbox, group |

## Links

- npm: https://www.npmjs.com/package/@jswork/react-ant-checkbox-group
- Repository: https://github.com/afeiship/react-ant-checkbox-group
- Homepage: https://github.com/afeiship/react-ant-checkbox-group#readme
- Issues: https://github.com/afeiship/react-ant-checkbox-group/issues
- npm.io page: https://npm.io/package/@jswork/react-ant-checkbox-group

## Dependencies (4)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [@jswork/noop](https://npm.io/package/@jswork/noop.md) ^1.0.0
- [@jswork/react-list](https://npm.io/package/@jswork/react-list.md) ^1.1.3
- [@jswork/rctpl-ant-checkbox](https://npm.io/package/@jswork/rctpl-ant-checkbox.md) ^1.0.1

## Recent versions

- 1.0.5 (latest) — 2021-09-14
- 1.0.4 — 2021-08-25
- 1.0.3 — 2021-07-24
- 1.0.2 — 2021-05-06
- 1.0.1 — 2021-05-06
- 1.0.0 — 2021-02-24

## README

# react-ant-checkbox-group
> React ant checkbox group.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install -S @jswork/react-ant-checkbox-group
```

## properties
| Name      | Type   | Required | Default          | Description                           |
| --------- | ------ | -------- | ---------------- | ------------------------------------- |
| className | string | false    | -                | The extended className for component. |
| value     | array  | false    | -                | Default value.                        |
| onChange  | func   | false    | noop             | The change handler.                   |
| onSearch  | func   | false    | noop             | The handler when search.              |
| items     | array  | false    | []               | The checkbox data source.             |
| template  | func   | false    | RctplAntCheckbox | The item template.                    |
| styleless | bool   | false    | false            | If no checkbox ui.                    |


## usage
1. import css
  ```scss
  @import "~@jswork/react-ant-checkbox-group/dist/style.css";

  // or use sass
  @import "~@jswork/react-ant-checkbox-group/dist/style.scss";

  // customize your styles:
  $react-ant-checkbox-group-options: ()
  ```
2. import js
  ```js
  import ReactDemokit from '@jswork/react-demokit';
  import React from 'react';
  import ReactDOM from 'react-dom';
  import ReactAntCheckboxGroup from '@jswork/react-ant-checkbox-group';
  import './assets/style.scss';

  class App extends React.Component {
    state = {
      value: ['k1', 'k3'],
      items: [
        { value: 'k1', label: 'label1' },
        { value: 'k2', label: 'label2' },
        { value: 'k3', label: 'label3' }
      ]
    };

    onChange = (inEvent) => {
      // console.log('chk change:', inEvent.target.value);
      this.setState({ value: inEvent.target.value });
    };

    render() {
      return (
        <ReactDemokit
          className="p-3 app-container"
          url="https://github.com/afeiship/react-ant-checkbox-group">
          <article className="message is-info mb-3">
            <div className="message-header">Demo</div>
            <div className="message-body">
              <div className="p-2">
                <ReactAntCheckboxGroup
                  name="abc"
                  value={this.state.value}
                  onChange={this.onChange}
                  onSearch={(e) => {
                    console.log('event:', e.target.value);
                  }}
                  items={this.state.items}
                />
              </div>

              <ReactAntCheckboxGroup
                name="abcd"
                styleless
                value={this.state.value}
                onChange={this.onChange}
                items={this.state.items}
              />
            </div>
          </article>

          <article className="message">
            <div className="message-header">Output</div>
            <div className="message-body">{JSON.stringify(this.state.value)}</div>
          </article>
        </ReactDemokit>
      );
    }
  }

  ReactDOM.render(<App />, document.getElementById('app'));

  ```

## documentation
- https://afeiship.github.io/react-ant-checkbox-group/


## license
Code released under [the MIT license](https://github.com/afeiship/react-ant-checkbox-group/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/react-ant-checkbox-group
[version-url]: https://npmjs.org/package/@jswork/react-ant-checkbox-group

[license-image]: https://img.shields.io/npm/l/@jswork/react-ant-checkbox-group
[license-url]: https://github.com/afeiship/react-ant-checkbox-group/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-ant-checkbox-group
[size-url]: https://github.com/afeiship/react-ant-checkbox-group/blob/master/dist/react-ant-checkbox-group.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/react-ant-checkbox-group
[download-url]: https://www.npmjs.com/package/@jswork/react-ant-checkbox-group

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