Button

Actions

Triggers actions or events. Supports multiple variants, sizes, loading state and icon slots.

Playground

Controls

Visual style of the button.

Size of the button.

Show spinner and disable interaction.

Disable the button.

Expand to full width.

Pill shape.

Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost' | 'destructive' | 'link' | 'outline''primary'Visual style.
size'sm' | 'md' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg''md'Size.
loadingbooleanfalseShow loading spinner.
disabledbooleanfalseDisable the button.
fullWidthbooleanfalseFull container width.
roundedbooleanfalsePill/fully rounded.
as'button' | 'a''button'Render as element.
hrefstringURL when as="a".
type'button' | 'submit' | 'reset''button'Native button type.

Examples

Primary
vue
<DsButton variant="primary">
  Primary
</DsButton>
Secondary
vue
<DsButton variant="secondary">
  Secondary
</DsButton>
Outline
vue
<DsButton variant="outline">
  Outline
</DsButton>
Ghost
vue
<DsButton variant="ghost">
  Ghost
</DsButton>
Destructive
vue
<DsButton variant="destructive">
  Delete
</DsButton>
Link
vue
<DsButton variant="link">
  Link
</DsButton>
Small
vue
<DsButton size="sm">
  Small
</DsButton>
Large
vue
<DsButton size="lg">
  Large
</DsButton>
Loading
vue
<DsButton loading>
  Loading
</DsButton>
Disabled
vue
<DsButton disabled>
  Disabled
</DsButton>
Full Width
vue
<DsButton fullWidth>
  Full Width
</DsButton>
Rounded
vue
<DsButton rounded>
  Rounded
</DsButton>

Skeleton

Use DsButtonSkeleton as a loading placeholder while content is being fetched.

Default
vue
<DsButtonSkeleton />
Small
vue
<DsButtonSkeleton size="sm" />
Large
vue
<DsButtonSkeleton size="lg" />
Rounded
vue
<DsButtonSkeleton rounded />
Custom Width
vue
<DsButtonSkeleton width="140px" />

Accessibility

  • Uses native <button> element by default for full keyboard and AT support.
  • Loading state sets aria-busy="true" and aria-disabled="true".
  • Focus ring visible on keyboard navigation.