Skip to content

Button

Button allows users to perform actions or navigate to other pages. Button has multiple styles to cater to various needs.

Button

Trigger actions when clicked.

Import

js
import { MpButton, MpButtonGroup } from '@mekari/pixel3'

Playground

API

MpButton

Props
Events
Slots
NameTypeDefault
as
Rendered tag of button.
stringbutton
size
Size of button.
sm | mdmd
variant
Variant of button.
primary | secondary | ghost | danger | textLinkprimary
is-disabled
If true, button will be disable.
booleanfalse
is-loading
If true, button will be show loading state.
booleanfalse
left-icon
Show icon on the left or create button icon.
IconName -
right-icon
Show icon on the right or create button icon.
IconName -

MpButtonGroup

Props
Slots
NameTypeDefault
spacing
Spacing of button in group.
SpacingToken | string2
is-split
Visual state of split button in group.
booleanfalse

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 Space or Enter key for activate state of button.