1.0.21 • Published 5 years ago

react-checkbox-selectable v1.0.21

Weekly downloads
47
License
MIT
Repository
github
Last release
5 years ago

react-checkbox-selectable

NPM JavaScript Style Guide

A checkbox selectable input table for large select options with support for drag and drop feature

Installation

Through npm:

npm install --save react-checkbox-selectable

Through yarn:

yarn add react-checkbox-selectable

Usage

import { CheckboxSelectable } from 'react-checkbox-selectable';

class Example extends Component {
  render () {
    return (
        <CheckboxSelectable
            items={items}
            selectedItems={selectedItems}
            onChange={selectedItems => {/* Do whatever you want with the selectedItems data*/}}
            customButton={CustomButton}
        />
    )
  }
}

Properties

NameTypeDefaultOptionDescription
itemsArray[]requiredlist of items.
selectedItemsArray[]requiredselected list to start with (subgroup of items).
onChangefunction(selectedItems)=>{}requiredcallback for changed event.
customButtonComponentButtonoptionaltoggle to show loading indication.

Notes

In current version, items given to the items and selectedItems props support only as the below format shown. This rule apply similarly as the selectedItems argument that passed through the onChange props. It is in future planning that the provision of getOptionLabel and getOptionId props to be added for better user experience.

 const items = [
    {id: 0, label: 'A'},
    {id: 1, label: 'B'},
    ...
 ]

In addition, drag and Drop feature is only supported on the selected items list.

Contributing

Feel free to make any pull request that will better enhance the component.

License

MIT © Wnyao

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago