-
Notifications
You must be signed in to change notification settings - Fork 2
Button Options
Brandon Karunakaran edited this page Mar 21, 2017
·
1 revision
The Button Options component is useful for displaying a list of options
-
text
- This prop must be astring
. -
type
- This prop must be astring
. -
onChange
- This prop must be afunction
. This gets passed a the value of the option that has been changed. -
onClick
- This prop must be afunction
. This is called when the main button is clicked not the option. -
isSmall
- This prop must be astring
. -
options
- This prop must be aarray
ofobjects
.
<ButtonOptions
text="Button Options"
type="primary"
onChange={this.onChange}
onClick={this.onClick}
isSmall={false}
options={[
{
title: "Option 1",
value: "option1",
body: "Vivamus in nunc. bibendum nunc, non.. turpis"
},
{
title: "Option 2",
value: "option2",
body: "Mauris elementum bibendum nunc, non posuere turpis venenatis eget."
},
{
title: "Option 3",
value: "option3",
body: "Suspendisse fermentum facilisis turpis, ut porttitor lacus mollis quis."
}
]}
/>
// ...React Component
onChange: function(value) {
console.log("this component has been changed", value)
},
onClick: function() {
console.log('A Button has been clicked');
},