Skip to content

Button Options

Brandon Karunakaran edited this page Mar 21, 2017 · 1 revision

ButtonOptions

The Button Options component is useful for displaying a list of options

Props

  • text - This prop must be a string.
  • type - This prop must be a string.
  • onChange - This prop must be a function. This gets passed a the value of the option that has been changed.
  • onClick - This prop must be a function. This is called when the main button is clicked not the option.
  • isSmall - This prop must be a string.
  • options - This prop must be a array of objects.

Example

<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');
},

Related