0.2.7 • Published 2 years ago

@essappstate/canopy-react-buttongroup v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@essappstate/canopy-react-buttongroup

A Bootstrap button group for AppStateESS/Canopy using React. Expects Bootstrap 4.

Install

npm install --save-dev @essappstate/canopy-react-buttongroup

Example

import ButtonGroup from '@essappstate/canopy-react-buttongroup'

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' // Color of active (matching) button. Bootstrap primary colors only
const color = 'primary' // Color of the inactive buttons and outlines.

return (
<ButtonGroup
  name="input_name"
  buttons={buttons}
  match={matchingValue}
  handle={setPersonAmount}
  vertical={false}
  color={color}
  activeColor={activeColor}/>
)
0.2.7

2 years ago

0.2.6

3 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

6 years ago