1.1.3 • Published 3 years ago

easy-select-react v1.1.3

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

✍️ CUSTOM SELECT / DROPDOWN ✍️

npm i easy-select-react

I always struggle to use HTML5 <select> and packages are sometimes overcomplicated for just a simple dropdown.

But... I am not really a fun of frameworks like Bootstrap, so I made my own! 👻

Here is what it looks like...

I made a React version (can be used with or without typescript) and a vanilla JS/HTML/CSS version! 📚

Documentation:

Styling:

CSS ClassChanges
select__wrapWidth, height, border-radius, bg color, text color.
select__optionsWidth of options, border-radius of dropdown.
single-optionHeight of options, padding, border + bg color.

React:

If you are already working on an app created with create-react-app you will not need to install anything.

Interfaces:

InterfaceUse
OptionSingle option. val will be passed to the parent component, display will be displayed on the interface.
OptionClassConstructor for Options, use to create the array for the options prop.

Props:

PropUse / Type
optionsArray of Option
selectedOptFunction that should set Option["val"] in the state (see example)