0.2.2 • Published 2 years ago
dropdown-lib-higex v0.2.2
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>