Name: react-simpler-select
Owner: Springload
Description: React component that renders a select. Supports optgroups, multiple selections.
Created: 2016-03-16 21:34:59.0
Updated: 2017-07-27 21:51:28.0
Pushed: 2017-06-14 22:30:33.0
Homepage: https://springload.github.io/react-simpler-select/
Size: 285
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
React component that renders a select. Supports optgroups, multiple selections.
Check out the online demo!
<select>
.<option>
elements itself from the expected data structure.placeholder
prop to create a placeholder option at the top of the select.<optgroup>
elements if the options
follow the expected data structure.onChange
returns supports single and multiple
values in a convenient format.install --save react-simpler-select
rt Select from 'react-simpler-select';
t options = [
value: 'en', label: 'English' },
value: 'es', label: 'Spanish' },
ect
aceholder="Choose a language"
lue="en"
tions={options}
Change={onChange}
dd props as you go, they will be transfered to the `select` element.
ect
lue="en"
tions={options}
Change={this.handleChange}
toFocus
upports `optgroup`s with their own array of options.
t optgroups = [
title: 'North Island',
id: 'ni',
options: [ { value: 'wgtn', label: 'Wellington' }, { value: 'gsb', label: 'Gisbourne' } ]
title: 'South Island',
id: 'si',
options: [ { value: 'ch', label: 'Christchurch' }, { value: 'qt', label: 'Queenstown' } ]
ect options={optgroups}/>
upports `multiple` select. Just make the `value` prop an array, and get selected options as an array in the `onChange` callback.
ect value={[ 'ch', 'qt']}/>
Clone the project on your computer, and install Node. This project also uses nvm.
install
en, install all project dependencies.
install
stall the git hooks.
ithooks/deploy
Everything mentioned in the installation process should already be done.
ke sure you use the right node version.
use
art the server and the development tools.
run start
ns linting.
run lint
ns tests.
run test
ew other available commands with:
run
package.json
, following semver.run dist
e irish-pub to check the package content. Install w/ npm install -g first.
h-pub
publish