Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/react-ant-checkbox-group
React ant checkbox group.
https://github.com/afeiship/react-ant-checkbox-group
ant checkbox group react
Last synced: 8 days ago
JSON representation
React ant checkbox group.
- Host: GitHub
- URL: https://github.com/afeiship/react-ant-checkbox-group
- Owner: afeiship
- License: mit
- Created: 2018-02-12T13:04:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T00:53:50.000Z (over 3 years ago)
- Last Synced: 2024-12-01T10:12:39.482Z (21 days ago)
- Topics: ant, checkbox, group, react
- Language: JavaScript
- Size: 623 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
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 (
Demo
{
console.log('event:', e.target.value);
}}
items={this.state.items}
/>
Output
{JSON.stringify(this.state.value)}
);
}
}ReactDOM.render(, 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