Buttons

Clickable actions in contextual color variants, three sizes, and outline, ink, ghost, ring, and icon looks, with built-in loading and disabled states. Filled primary and status chrome uses contrast-aware on-fill ink (--vd-text-on-primary / --vd-text-on-status): bright hues keep dark labels in light and dark.

Button Variants
Button Sizes
Button States

Press is the live :active state — hold it down.

Ghost Buttons
Ink Buttons

A fat single outline on the border box — not the detached .vd-btn-ring halo, and not the 1px .vd-btn-outline stroke that fills primary on hover. Rest is transparent; hover fills black with a white label in light, and solid primary with on-fill ink in dark. Use it as variant="ink" or .vd-btn-ink on a link styled as a button.

Ring Buttons

A detached outer ring for the one action you want read first on a screen that already uses solid buttons everywhere. It is a modifier, not a variant — add .vd-btn-ring to whatever button you already have. The gap is transparent, so it keeps working on cards, glass and imagery.

Icon Buttons
Loading State
Class Reference

Usage

Saved 0 times
<script setup lang="ts">
import { ref } from "vue";
import { VdButton } from "@vanduo-oss/vd3";

const saves = ref(0);
function save() {
  saves.value++;
}
</script>

<template>
  <div class="vd-d-flex vd-flex-wrap vd-gap-3 items-center">
    <VdButton variant="primary" @click="save">Save</VdButton>
    <VdButton variant="ink" ring @click="save">Save with ring</VdButton>
    <span role="status">Saved {{ saves }} times</span>
  </div>
</template>

Classes

ClassDescriptionType
.vd-btnBase button class — required on all buttonsBase
.vd-btn-primaryPrimary action colorVariant
.vd-btn-secondarySecondary/neutral action colorVariant
.vd-btn-successSuccess/positive action colorVariant
.vd-btn-warningWarning/caution action colorVariant
.vd-btn-dangerDanger/destructive action color — unified status name (matches Vue variant="danger")Variant
.vd-btn-errorRetained backward-compatible alias for .vd-btn-dangerVariant
.vd-btn-infoInformational action colorVariant
.vd-btn-outlineOutlined button (neutral border)Variant
.vd-btn-outline-primaryOutlined button with primary colorVariant
.vd-btn-outline-secondaryOutlined button with secondary colorVariant
.vd-btn-inkFat single 2px outline (not the ring). Hover fills black in light. On this docs site in dark, hover fills solid primary with dark ink. Also VdButton variant="ink".Variant
.vd-btn-smSmall button sizeSize
.vd-btn-lgLarge button sizeSize
.vd-btn-blockFull-width block buttonSize
.vd-btn-ghostTransparent background with hover tintVariant
.vd-btn-ghost-primary … .vd-btn-ghost-subtleGhost with color-tinted hover statesVariant
.vd-btn-iconCircular icon-only buttonModifier
.vd-btn-ringDetached outer ring with a transparent gap — layers on any variant and size. Suppressed inside .vd-btn-group. Tune with --vd-btn-ring-width / -gap / -colorModifier
.is-loadingLoading state — blanks the label and shows a spinner (prefer a .vd-btn-spinner child, matching VdButton; legacy ::after alone is fine for outline/ghost)State (class)
.vd-btn-spinnerReal spinner element used by VdButton :loading — suppresses the legacy ::after and keeps solid-variant colours correctState (child)
.vd-btn-fullAlias of .vd-btn-block — full-width (display: block)Size
disabledDisables interaction and dims buttonState (attr)

Component API (Vue 3)

Prop / eventDescription
:variantprimary | secondary | success | warning | danger | info, or "ghost" / "ink" (default "primary").
:sizesm | md | lg (default "md").
:loadingShows a spinner and blocks clicks (adds .is-loading and a .vd-btn-spinner child; label is blanked).
:disabledDisables the button.
:ringDraws a detached outer ring around the button (adds .vd-btn-ring). Layers on any variant and size; default false.
:typebutton | submit | reset (default "button").
@clickEmitted on click (suppressed while disabled or loading).
:outlineAdds .vd-btn-outline. Default false.
:blockAdds .vd-btn-block so the button fills its row. Default false.
:iconAdds .vd-btn-icon for a square icon button. Default false.
Accessibility
  • VdButton renders a native <button> element (default type="button") with visible :focus-visible outline rings.
  • Icon-only buttons (.vd-btn-icon or :icon="true") must provide an explicit aria-label describing the action.
  • When :loading="true", VdButton sets disabled, marks the spinner aria-hidden="true", and suppresses @click emissions.
  • Filled primary and status buttons use contrast-aware foreground tokens (--vd-text-on-primary and --vd-text-on-status) across light and dark themes.