0.1.3 • Published 6 years ago

react-multiselect-list v0.1.3

Weekly downloads
11
License
ISC
Repository
github
Last release
6 years ago

React Multi-list Selector

Install

$ npm i --save react-multiselect-list

Use it in any component

import React, {Component} from 'react';
import Multiselect from 'react-multiselect-list';

class <your_componenet> extends Component {
    your_function (selectedValues) {
        // 'selectedValues' contains your selected values
        // You can set state here
    }
    
    render () {
        return(
            <Multiselect list=['item1', 'item2', 'item3'] title='title' onSelectItem={this.your_function.bind(this)} />
        )
    }
}

Props

NameTypeRequiredDescription
listArrayYesThe List of items you'll be selecting from
titlestringYesTitle of your list
onSelectItemFunctionYesCallback from your component
selectedArrayNoPass values that you want selected by default
themeStringNoChoose from ('red', 'green', 'lightblue', 'yellow', 'blue') to match with your theme. Blue is the default theme

Development

$ git clone https://github.com/hkureshy/react-multiselect-list.git
$ cd react-multiselect-list
$ npm install
$ npm start

Feel free to contact if you find any problem using this package.
Email: hassnainkureshy@gmail.com