dynamic-dropdown
v1.0.0
Published
You can create dynamic dropdown by passing an array according to your requirements. This package will mostly fullfill many kind of dropdown menu component requirements when developing react apps.
Downloads
3
Readme
dynamic-dropdown
You can create dynamic dropdown by passing an array according to your requirements. This package will mostly fullfill many kind of dropdown menu component requirements when developing react apps.
Install
npm install --save dynamic-dropdown
Usage
import React from 'react'
import { DropDown } from 'dynamic-dropdown'
import 'dynamic-dropdown/dist/index.css'
const App = () => {
const options = [
{ value: 'Spring', label: 'Spring' },
{ value: 'Summer', label: 'Summer' },
{ value: 'Autumn', label: 'Autumn' },
{ value: 'Winter', label: 'Winter' }
]
const styles = {
selection: { width: 300, borderRadius: 10 }, //Styles for dropdown menu
div: {}, //Styles for div
options: {} //Styles for dropdown selection option
}
return (
<DropDown
elements={options}
selection={styles.selection}
div={styles.div}
options={styles.options}
/>
)
}
export default App
License
MIT © PasinduS96