🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-editable-select

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-editable-select

A select component that can be switched to text input to allow adding new elements.

1.0.0
latest
npm
Version published
Weekly downloads
19
72.73%
Maintainers
1
Weekly downloads
 
Created
Source

react-editable-select

A select component that can be switched to text input to allow adding new elements.

Prerequesites

  • reactstrap
  • bootstrap
  • font-awesome
  • yarn
  • webpack
  • es6

Try it out

  • Activate nodejs
nvm use
  • Install yarn
npm -g install yarn
  • Start webpack dev server
yarn start
  • Goto http://localhost:3001/

How to use

import {EditableSelect} from 'react-editable-select';

...

<EditableSelect
    options={options}
    value={selectedOption}
    getOptionValue={(option) => option.id}
    getOptionLabel={(option) => option.name}
    createOption={(text) => { return {id: 1, name: text} }}
    onChange={(ev, option) => ...}
    />
PropertyDescription
optionsArray of options
valueCurrently selected option
getOptionValueCallback to convert option into option key
getOptionLabelCallback to convert option into option label
createOptionCallback to create a new option
onChangeCallback invoked when option is selected or text field changes

License

MIT

Keywords

react

FAQs

Package last updated on 29 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts