0.2.2 • Published 1 year ago

dropdown-lib-higex v0.2.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

dropdown-lib-higex

A library of React components created using create-react-app.

Installation

Run the following command: npm install dropdown-lib-higex

Usage

Prop nameTypeDescription
optionsarrayList of options to choose in the dropdown menu, needs a name and a key per option
defaultOptionstringDefault message displayed before the option selection
onChangefunctionGet the value of the clicked option from the dropdown

Array format

const options = [
  { name: "Sales", key: "sal" },
  { name: "Marketing", key: "mar" },
  { name: "Engineering", key: "eng" },
  { name: "Human Ressources", key: "hr" },
  { name: "Legal", key: "leg" },
];

Calling the components

<Dropdown
  options={options}
  defaultOption="Select Department"
  onChange={onChange}
></Dropdown>