Skip to content

Button

Triggers actions. Supports four variants, three sizes, loading and disabled states.

Appearance

Primary

The default button. Use for the single primary action on a surface — save, submit, create.

Tailwind v4
vue
<Button>Save changes</Button>

Secondary

Use for secondary actions alongside a primary button — cancel, back, export.

Tailwind v4
vue
<Button variant="secondary">Cancel</Button>

Ghost

Use for tertiary or low-priority actions — more options, collapse, toolbar controls.

Tailwind v4
vue
<Button variant="ghost">More options</Button>

Danger

Use for destructive, irreversible actions — delete, remove, revoke. Always pair with a confirmation step.

Tailwind v4
vue
<Button variant="danger">Delete record</Button>

All variants

Tailwind v4
vue
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="danger">Danger</Button>

Sizes

Small

Use in dense UI — table toolbars, filter rows, inline actions where vertical space is constrained.

Tailwind v4
vue
<Button size="sm">Small</Button>

Medium

The default size. Use in forms, modals, and page-level actions.

Tailwind v4
vue
<Button size="md">Medium</Button>

Large

Use for prominent page-level CTAs or marketing-style actions.

Tailwind v4
vue
<Button size="lg">Large</Button>

States

Loading

When loading is true, a spinner replaces the icon slot and the button is automatically disabled. Use for async actions where you need to prevent re-submission.

Tailwind v4
vue
<Button :loading="saving" @click="save">
  Save changes
</Button>

Disabled

Tailwind v4
vue
<Button :disabled="!form.isValid">Submit</Button>

Common patterns

Form actions

A primary and secondary button pair is the standard form footer layout.

Tailwind v4
vue
<template #footer>
  <Button variant="secondary" @click="$emit('close')">Cancel</Button>
  <Button :loading="saving" type="submit">Save changes</Button>
</template>

Full width

Pass class="w-full" — extra classes are appended safely via extraClass computed.

Tailwind v4
vue
<Button class="w-full">Continue</Button>

Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost' | 'danger''primary'Visual style
size'sm' | 'md' | 'lg''md'Button size
loadingbooleanfalseShow spinner and disable the button
disabledbooleanfalseDisable the button
type'button' | 'submit' | 'reset''button'Native button type

Slots

SlotDescription
defaultButton label or content

Private — Jetpack Labs internal use only