@midly/react-dropdown
v2.1.1
Published
React-dropdown is a simplest way to create a dropdown on your ReactJS site.
Downloads
4
Maintainers
Readme
React-dropdown
React-dropdown is a simplest way to create a dropdown on your ReactJS site.
- Very small (less than 11Kb)
- Mobile friendly
Getting Started
Install this package:
npm i @midly/react-dropdown
Import the component, and define the options.
All other attributes are optional.
If a default value is not defined, the first option will be selected.
You can add all <select />
compatible attributes as wanted.
import { Dropdown } from '@midly/react-dropdown';
const options = [
'Sales',
'Marketing',
'Engineering',
'Human Ressources',
'Legal'
]
<Dropdown
label="Department" //optional
labelclassname="block my-1" //optional
options={options} //required
defaultValue={Engineering} //optional
onChange={onChange} //optional
onBlur={onBlur} //optional
className="form-select bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg block w-full p-2.5" //optional
/>