Appearance
Button
A clickable action component from @pixlet/button.
Variants
vue
<PixButton variant="primary">Primary</PixButton>
<PixButton variant="secondary">Secondary</PixButton>Sizes
Loading
Installation
bash
pnpm add @pixlet/button @pixlet/tokensAPI
| Prop | Type | Default |
|---|---|---|
variant | 'primary' | 'secondary' | 'primary' |
size | 'sm' | 'md' | 'md' |
disabled | boolean | false |
loading | boolean | false |
type | 'button' | 'submit' | 'reset' | 'button' |
The component forwards native button events and attributes through Vue's fallthrough attributes.
Use the default slot for the button label. A loading button keeps the slot visible, disables native activation, and exposes aria-busy="true".
Styling tokens
| Token | Controls |
|---|---|
--pix-button-bg | Primary background |
--pix-button-fg | Primary label color |
--pix-button-hover-bg | Primary hover background |
--pix-button-secondary-bg | Secondary background |
--pix-button-secondary-fg | Secondary label and border color |
--pix-button-focus-ring | Keyboard focus outline color |
--pix-button-radius | Corner radius |
--pix-button-gap | Gap between the spinner and label |