0.1.2 • Published 3 years ago

react-any-dropdown v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

React Any Dropdown

Customizable dropdown with the option to multi-select!

Install

npm i -s react-any-dropdown

Usage

Being customizable, the dropdown will accept a number of props to change the look and function of your dropdown

PropTypeDescriptionDefault
borderWidthnumberThe width of the border for the dropdown1px
borderColorstring (color)The color of the border for the dropdown#D9D9D9
buttonColorstring (color)background color of the button of the dropdownwhite
contentBackgroundColorstring (color)background color of the collapsed view (content) of the dropdownwhite
maxContentHeightnumbermaximum height of the collapsed view (content) of the dropdown100px
contentWidthnumberwidth of the collapsed view (content) of the dropdown300px
downArrowColorstring (color)color of the arrow inside the dropdown button when collapsed (pointing downward)#8C8C8C
upArrowColorstring (color)color of the arrow inside the dropdown button when expanded (pointing upward)#8C8C8C
selectedBackgroundColorstring (color)color of the selected item or option in the dropdownlightblue
selectedTextColorstring (color)color of the text of the selected item or option in the dropdown as it shows in the dropdown button#454545
onSelectfunctionany function you'd like the dropdown to do to the selected item once it is selected
onUnSelectfunction(for multiselect) any function you'd like the dropdown to do to the selected item once it is unselected
multiselectbooleanif true, dropdown will be multiselected. Selected items will be joined with "," and can be passed on to other functionsfalse
placeholderstringany placeholder that will display when no item is selected"Select an item"
buttonWidthnumberwidth of the overall button for the dropdown150px
Example
import React from 'react'
import Dropdown from 'react-any-dropdown'
import styles from './style'

const App = () => {
 return (
		<div style={styles.container}>
			<Dropdown options={['test1', 'test2', 'test3']}/>
		</div>
 )
}

export default App