-
Notifications
You must be signed in to change notification settings - Fork 2
Button Group
brandonk1234 edited this page Dec 5, 2016
·
6 revisions
This component is useful for grouping a series of buttons together on a single line.
The props needed for this component are listed and explained below:
-
className
- This prop must be astring
. -
buttonType
- This prop must be astring
. -
value
- This prop must be astring
. -
buttons
- This prop must be aobject
. In the object you must have two keys that come with a value. These are a _icon and _value. -
onChange
- This prop must be afunction
. This will also get passed back a value. -
isSmall
- This prop must be aboolean
. Use this to have a smaller version of the component
<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)
}