Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

react-multiselect-list

0.1.3 • Public • Published

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

Name Type Required Description
list Array Yes The List of items you'll be selecting from
title string Yes Title of your list
onSelectItem Function Yes Callback from your component
selected Array No Pass values that you want selected by default
theme String No Choose 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

Install

npm i react-multiselect-list

DownloadsWeekly Downloads

4

Version

0.1.3

License

ISC

Unpacked Size

11.1 kB

Total Files

5

Last publish

Collaborators

  • avatar