Buttons are basic interface elements that initialize an action or function when the user interacts with them. The appearance of the button should suggest the user takes an action that leads to different scenarios. These elements that reinforce to the user the necessity to interact are called CTA (Call to Action) components, which basically are designed to capture user attention and improve the user experience within the application.
Name | Default | Description |
---|---|---|
mode: 'primary' | 'secondary' | 'text' | 'primary' | The available button modes. |
type: 'button' | 'reset' | 'submit' | 'button' | 'type' html prop of the button. |
label: string | Text to be placed in the button. | |
icon: node | string | Element or path used as the icon that will be placed next to the button label. | |
iconPosition: 'before' | 'after' | 'before' | Whether the icon should appear after or before the label. |
disabled: boolean | false | If true, the component will be disabled. |
onClick: function | This function will be called when the user clicks the button. | |
margin: string | object | Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes. | |
size: string | 'fitContent' | Size of the component ('small' | 'medium' | 'large' | 'fillParent' | 'fitContent'). |
tabIndex: number | 0 | Value of the tabindex attribute. |