p14_dropdownmenu
v1.1.0
Published
Package React for a drop down menu
Downloads
3
Readme
P14_DropDownMenu
To import this package to your project
- run
npm i p14_dropdownmenu
Importing into React
import DropDownMenu from 'p14_dropdownmenu';
<DropDownMenu name{name} id={id} className={className} data={data}/>
Props
- name: html tag name
- id: html tag id
- className: your custom css class
- data: a json with a name key
Json file formatting
- The json MUST have a
name
key, each key will be a choice in the select menu. - Two examples of json file used for this package : StateList.json and DepartmentList.json
- You don't necessary need a JSON file, you can just pass your data like this too :
const data = [
{
"name": "1"
},
{
"name": "2"
}
...
]
<DropDownMenu name{name} id={id} className={className} data={data}/>
1. About this package
This is a React component to create a custom select menu.
1.1 Prerequisites
If you are working with several versions of NodeJS, we recommend you install nvm. This tool will allow you to easily manage your NodeJS versions.
2. Launching the app
2.1 Installing dependencies
- Fork the repository
- Clone it on your computer
- Open in your IDE
- run
yarn install
to install the dependencies