8000 GitHub - rmartide/ReactCustomDropdownInput at v1.0.3
[go: up one dir, main page]

Skip to content

rmartide/ReactCustomDropdownInput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React CustomDropdownInput

It is an input with a dropdown.

The dropdown gets triggered on focus.

The input has the bootstrap class form-control but bootstrap is not needed.

Demo

Live demo

Props

  • values -> is an array and it will be shown as options in the dropdown
const options1 = [
      { id: 1, label: 'John' },
      { id: 2, label: 'Miles' },
      { id: 3, label: 'Charles' },
      { id: 4, label: 'Herbie' },
    ];
  • handleChange -> gets called everytime the user types on the input
handleChange = (value) => {
    //value is the input typed
  }
  • handleSelected -> gets called everytime the user clicks on a dropdown option
 handleSelected = (option) => {
    ///option is the option selected on the dropdown
  }

Usage

<CustomDropdownInput values={options1} handleSelected={this.handleSelected} handleChange={this.handleChange} />

About

React component. It is an input with dropdown.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0