canopy-react-buttongroup

0.1.5 • Public • Published

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>&nbsp; Person</span>
  }, {
    value: '2',
    label: <span>
        <i className="fas fa-users"></i>&nbsp; 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}/>
)

Readme

Keywords

Package Sidebar

Install

npm i canopy-react-buttongroup

Weekly Downloads

2

Version

0.1.5

License

MIT

Unpacked Size

16.9 kB

Total Files

6

Last publish

Collaborators

  • mcnaneym