Wondering what’s next for npm?Check out our public roadmap! »

    @essappstate/canopy-react-buttongroup

    0.2.4 • Public • Published

    @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}/>
    )

    Keywords

    Install

    npm i @essappstate/canopy-react-buttongroup

    DownloadsWeekly Downloads

    12

    Version

    0.2.4

    License

    MIT

    Unpacked Size

    18.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar