npm.io
0.2.2 • Published 3 years ago

dropdown-lib-higex

Licence
Version
0.2.2
Deps
4
Size
8 kB
Vulns
0
Weekly
0

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 name Type Description
options array List of options to choose in the dropdown menu, needs a name and a key per option
defaultOption string Default message displayed before the option selection
onChange function Get 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>

Keywords