kodobe-react-select
v2.2.2
Published
Kodobe React Select
Downloads
3
Readme
Kodobe React Select
This is a simple react dropdown package
Install
npm install kodobe-react-select
or
yarn add kodobe-react-dropdown
Setup
import Select from 'kodobe-react-dropdown';
Usage
import Select from "kodobe-react-dropdown";
function App() {
return (
<div>
<h3>Here is how to use a dropdown</h3>
<br />
<Select
placeholder="Select your value"
options={[
{ title: "Text 1", value: "text1" },
{ title: "Text 2", value: "text2" },
{ title: "Text 3", value: "text3" },
{ title: "Text 4", value: "text4" },
{ title: "Text 5", value: "text5" },
{ title: "Text 6", value: "text6" },
{ title: "Text 7", value: "text7" },
{ title: "Text 8", value: "text8" },
{ title: "Text 9", value: "text9" },
{ title: "Text 10", value: "text10" },
]}
value={selectVal}
onChange={(e) => setSelect(e)}
/>
</div>
);
}
Options
- options: List of object of structure {title:"title", value:"value"}
- placeholder: select placeholder (string)
- value: select value (number/string)
- onChange: handle selection change in dropdown (function)
- style: style object
- className: string