Skip to content

AdeleD/react-select-multiple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-select-multiple

A ReactJS component to render a multiselect (with a filter).

This component creates a list of checkboxes to select options. Behind the scenes an hidden tag <select> is updated with your selected options.

Example

Installation

Install react-select-multiple with npm:

$ npm install react-select-multiple

For CommonJS users:

var Multiselect = require('react-select-multiple');

Options

  • list (required) [array]: the initial list of options as an array of objects like that:
[
    {value: "FR", title: "France"},
    {value: "BE", title: "Belgique"},
    {value: "ES", title: "Espagne"},
    {value: "IT", title: "Italie"},
    {value: "DE", title: "Allemagne"}
]
  • selectors [bool]: if set to true, it display links to select all/none options
  • selectAllLabel [string]: the "select all" label
  • selectNoneLabel [string]: the "select none" label
  • checkedByDefault [array]: a list of preselected options. Example:
[
    {value: "BE", title: "Belgique"},
    {value: "ES", title: "Espagne"}
]
  • filterPlaceholder [string]: a placeholder for the input filter

Demo

Clone the repository and move into:

$ git clone [email protected]:AdeleD/react-select-multiple.git
$ cd react-select-multiple

Open the file example/index.html to see the result.

About

A ReactJS component to render a multiselect

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published