2.1
Button
Trigger actions when clicked.
Import
js
import { MpButton, MpButtonGroup } from '@mekari/pixel3'Playground
API
MpButton
Props
Events
Slots
| Name | Type | Default |
|---|---|---|
as | string | button |
size | sm | md | md |
variant | primary | secondary | ghost | danger | textLink | primary |
is-disabled | boolean | false |
is-loading | boolean | false |
left-icon | IconName | - |
right-icon | IconName | - |
is-full-width | boolean | false |
MpButtonGroup
Props
Slots
| Name | Type | Default |
|---|---|---|
spacing | SpacingToken | string | 2 |
is-split | boolean | false |
Usage
Variant
Size
With Icon
Button Icon
Button Group
Other
Accessibility
WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/button/
- Provide aria-label and or aria-labelledby when use Button Icon.
- When disabled, button has aria-disabled set to true.
- When focused, pressing
SpaceorEnterkey for activate state of button.