Skip to content

Instantly share code, notes, and snippets.

@brumm
Created December 7, 2016 16:12
Show Gist options
  • Save brumm/87c6e3c3e4482b6ce2974267a7b0cd0f to your computer and use it in GitHub Desktop.
Save brumm/87c6e3c3e4482b6ce2974267a7b0cd0f to your computer and use it in GitHub Desktop.
untitled
var MultiToggle = require('react-multi-toggle')
const groupOptions = [
{
displayName: 'Couple',
value: 2
},
{
displayName: 'Family',
value: 4
},
];
class Example extends React.Component {
constructor(props) {
super(props);
this.state = {
groupSize: 2
};
}
onGroupSizeSelect = value => this.setState({ groupSize: value });
render = () => {
const { groupSize } = this.state;
return (
<MultiToggle
options={groupOptions}
selectedOption={groupSize}
onSelectOption={this.onGroupSizeSelect}
label="Select Group Size"
/>
);
}
}
<Example />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment