canopy-react-buttongroup
v0.1.5
Published
Button group for Canopy/phpwebsite
Downloads
7
Readme
canopy-react-buttongroup
A Bootstrap button group for AppStateESS/Canopy using React. Expects Bootstrap 4.
const buttons = [
{
value: '1',
label: <span>
<i className="fas fa-user"></i> Person</span>
}, {
value: '2',
label: <span>
<i className="fas fa-users"></i> People</span>
}
]
const matchingValue = '1' // Person
const setPersonAmount(val) {
this.setState({persons : val})
}
const activeColor = 'success' // Bootstrap primary colors only
return (
<ButtonGroup
name="input_name"
buttons={buttons}
match={matchingValue}
handle={setPersonAmount}
vertical={false}
activeColor={activeColor}/>
)