1.0.0 • Published 6 years ago

react-option-chooser v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

React component for choosing among several options

Usage

import Chooser from 'react-option-chooser';

const Something = props => <div>
	<Chooser onSelect={this.select} />
</div>
...

Props

proptypedefaultdescription
onSelectfunc.requiredundefinedcallback when an option is selected, passes (option, index)
optionsarray'option1', 'option2'array of options, for now only text supported
hideAfterSelectboolfalseshould the entire component hide after an option is selected
unselectPossibleboolfalseshould the user be able to deselect currently selected component by clicking it
reselectPossiblebooltrueshould the user be able to select another option after already choosing