Skip to content

Button Group

brandonk1234 edited this page Dec 5, 2016 · 6 revisions

ButtonGroup

This component is useful for grouping a series of buttons together on a single line.

Props

The props needed for this component are listed and explained below:

  • className - This prop must be a string.
  • buttonType - This prop must be a string.
  • value - This prop must be a string.
  • buttons - This prop must be a object. In the object you must have two keys that come with a value. These are a _icon and _value.
  • onChange - This prop must be a function. This will also get passed back a value.
  • isSmall - This prop must be a boolean. Use this to have a smaller version of the component

Example

<ButtonGroup 
    onChange={this.onChange} 
    buttonType="primary" 
    value="menu"
    className="group-view" 
    buttons={
        [{"_icon": "menu", "_value": "menu"}, 
         {"_icon": "trash", "_value": "trash"}, 
         {"_icon": "check", "_value": "check"} 
        ]} 
/>
// ...React Component
onChange: function(value) {
    console.log("this component has been changed", value)
}

Related