Skip to content
brandonk1234 edited this page Dec 5, 2016 · 10 revisions

Button

A Button indicates a possible interaction. A standard Button element in Evolve usally consists of an onClick event along with some text and an icon.

Props

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

  • icon - This prop must be a string and will add the classname of icon-[icon], e.g. "icon-star"

  • iconPostion - This prop must be a string. Without this prop on your component, the icon at default is postioned on the left side. You may only position the icon to the left or to the right.

  • text - This prop must be a string. This is the main text that will displayed on the button.

  • className - This prop must be a string. You have the ability to give your button a specific className.

  • onClick - This prop must be a function.

  • type - This prop must be a string.

  • isSmall - This prop must be a boolean. Use this to have a smaller version of the component

Example

<Button 
    icon="key"
    iconPosition="left"
    text="Primary Button"
    type="primary"
    className="button-component"
    onClick={this.onClick}/>

// ...React Component
onClick: function() {
    console.log('this button has been clicked');
}

Related