dropdown-component-library
v0.1.7
Published
React component to easily create customizable dropdown
Downloads
3
Maintainers
Readme
dropdown-component-library
Simple React Dropdown component created using create-react-app
Prerequisites for install
Installation
- using NPM
$ npm install dropdown-component-library
Link to access the package here
Basic Usage
Import the Dropdown component in your React components:
import { Dropdown } from "dropdown-component-library";
After you've imported the Dropdown component, you're ready to start using Dropdown inside your components! 🎉
import React from "react";
import { Dropdown } from "dropdown-component-library";
const myData = ["Paris", "Nantes", "Toulouse"];
const App = () => {
return <Dropdown options={myData} />;
};
export default App;
You can also use attributes like: placeholder, width, onSelect
import React from "react";
import { Dropdown } from "dropdown-component-library";
const myData = ["Paris", "Nantes", "Toulouse"];
const App = () => {
return (
<Dropdown
options={myData}
placeholder="Select your city"
width="500px"
onSelect={(value) => console.log(value)}
/>
);
};
export default App;
I'm open for suggestions & PR :-)