combobox-with-input

2.3.0 • Public • Published

React-ComboBoxWithInput

React component that lets you select from a listed option like in drop down list or combo box as well as by entering a value, like an input box.

  • Modify look with custom styles using the different classnames (inspect dom for the classnames)
  • list options can be in either of the two forms

[{key: "Grade A", value: "10"}, {key: "Grade B", "value:"15"}]

or

[10, 15] / ['10', '15']

Intallation

npm i combobox-with-input --save

Props

PropTypeDescription
onChangefuncEntered Value as callback argument
onKeyUpfuncKey up event object as callback argument
onOptionSelectedfuncSelected Option as callback argument
onLabelClickfuncclick event as callback argument
optionsarraydrop down options array. Can be passed either as array of objects formatted - {key:'key1', value:'value1'} or array of string - ['option1', 'option2]
dispValstringdisplayed string when component is not focused
inputValstringdisplayed string inside the input box
selectedOptionStyleobject (optional)valid style object to distinguish the selected option in the dropdown list
optionFormatterfuncselected option from the passed options array as callback argument

Demo

Demo Link

Package Sidebar

Install

npm i combobox-with-input

Weekly Downloads

4

Version

2.3.0

License

ISC

Last publish

Collaborators

  • vishaldaga