Skip to content

vishalvisd/React-ComboBoxWithInput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

React component for ComboBox plus InputBox

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages