Code
<PyxisButton
@click="handleClick"
label="Button"
data-testid="button"
/>
Props
The Button component supports the following props:
Name |
Type |
Default |
Required |
---|---|---|---|
dataTestid |
string |
undefined |
true |
label |
string |
undefined |
false |
variant |
'primary' | 'secondary' | 'tertiary' |
'primary' |
false |
color |
'primary' | 'danger' |
'primary' |
false |
size |
'default' | 'compact' |
'default' |
false |
disabled |
boolean |
false |
false |
type |
'button' | 'reset' | 'submit' |
'button' |
false |
isLoading |
boolean |
false |
false |
counter |
string |
undefined |
false |
loadingMessage |
string |
undefined |
false |
leftIconClass |
string |
undefined |
false |
rightIconClass |
string |
undefined |
false |
labelledBy |
string |
undefined |
false |
Events
The interactions on the Button component are handled by the following Events
- @click : This event is triggered when the button is clicked