0.2.9 • Published 2 years ago

select-react-component v0.2.9

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Getting started with the Select React Component

A very simple but efficient select react component

What is it?

It is a dropdown menu component. When you click on it, a menu appears. From that menu, you choose an option, it will update the button.

Install it

npm install select-react-component
import { Select } from "select-react-component"

How to use it?

The list of items of your dropdown menu is an array of data. So if you want to create your list of items, you will have write your data as follow: data={array}

If you want to display a default value, you just need to give to value the desired value: it could be a string or the first data of your array: value={array}

Example: You have create a list of pokemon, so the user can choose his/her first pokemon. Let's say you have choice between three pokemons only (yeah, no pikachu. Back to Green/Blue/Red versions of pokemon). Your list will be: Bulbasaur, Charmander, Squirtle

const pokemonList = ["Bulbasaur", "Charmander", "Squirtle"];
<Select 
    data={pokemonList}
    value={pokemonList[0]} />
0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago