Generate nice drop-down lists (<select>).
npm i react-nice-looking-select
- Import the plugin in your project like this :
import NiceLookingSelect from "react-nice-looking-select";
- Set your options :
const options = [
"Hamburger",
"Fries",
"Pizza",
"Pasta",
"Tenders",
"Hot-Dog",
"Kebab",
"Tacos"
]
- In the return :
<NiceLookingSelect options={options} parameter={parameter} />
- Retrieve the selected value : You need to retrieve the element containing the class "selected-item--YOUR_ID_SELECT".
- Put this into your file :
const parameter = {
"backgroundColor": "#2D2D2D",
"borderRadius": "10px",
"centerOptions": true,
"centerTitle": true,
"chevronsColor": "#E5E5E5",
"columnsNumber": 2,
"fontColor": "#E5E5E5",
"hoverColor": "#4ED8E0",
"id": "select-meal",
"showChevrons": true,
"title": "Select your favorite meal"
}
MIT © sebastien-d-me