v1.3.0 28

Button

A clickable control that triggers an action.

Variants

Five styles. There is only one ghost; an action that reads as a text link is a Link.

html
<button class="vt-btn vt-btn-primary">
  Primary
</button>
<button class="vt-btn vt-btn-secondary">
  Secondary
</button>
<button class="vt-btn vt-btn-bordered">
  Bordered
</button>
<button class="vt-btn vt-btn-ghost">
  Ghost
</button>
<button class="vt-btn vt-btn-danger">
  Danger
</button>

Sizes

Available in small, default, large, extra-large and icon sizes; the corner radius and the icon grow with the size: with a label the icon is 16 (SM), 20 (MD, LG) or 24 (XL); an icon-only button is a step larger — 20, 20, 24, 24.

html
<button class="vt-btn vt-btn-primary vt-btn-sm">
  Small
</button>
<button class="vt-btn vt-btn-primary">
  Default
</button>
<button class="vt-btn vt-btn-primary vt-btn-lg">
  Large
</button>
<button class="vt-btn vt-btn-primary vt-btn-xl">
  Extra large
</button>
<button class="vt-btn vt-btn-primary vt-btn-icon" aria-label="Continue">

  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg>
</button>

Active

A button whose menu is open looks pressed while the menu is shown. The dropdown sets aria-expanded to true on its trigger and that is enough; vt-active gives the same look by class (a button picked in a toolbar). In Figma it is State=Pressed: an open menu and a press look the same.

html
<button type="button" class="vt-btn vt-btn-bordered vt-btn-sm" aria-haspopup="menu" aria-expanded="true"><span>Sort</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg></button>
<button type="button" class="vt-btn vt-btn-ghost vt-btn-icon vt-btn-sm vt-active" aria-label="More" aria-pressed="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M12 12H12.5M19 12H19.5M5 12H5.5M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13ZM19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13ZM5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg></button>

With Icon

An icon before or after the label. In Figma they are Show Left Icon and Show Right Icon — on in the main component, switched off on an instance that needs no icon — with Left Icon and Right Icon to swap the glyph — a button has no slot. The icon keeps its own size: set it on the instance, or bind it to a variable.

html
<button class="vt-btn vt-btn-primary">

  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M2.99994 17C2.99994 17.93 2.99994 18.395 3.10216 18.7765C3.37956 19.8117 4.18821 20.6204 5.22348 20.8978C5.60498 21 6.06997 21 6.99994 21L16.9999 21C17.9299 21 18.3949 21 18.7764 20.8978C19.8117 20.6204 20.6203 19.8117 20.8977 18.7765C20.9999 18.395 20.9999 17.93 20.9999 17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16.5 7.49993C16.5 7.49993 13.1858 2.99997 12 2.99996C10.8141 2.99995 7.50002 7.49996 7.50002 7.49996M12 3.99996V16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg>
  Upload
</button>
<button class="vt-btn vt-btn-bordered">

  Next
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M9.00005 18C9.00005 18 15 13.5811 15 12C15 10.4188 9 6 9 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg>
</button>
<button class="vt-btn vt-btn-primary">

  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
    <path d="M2 6L8.91302 9.91697C11.4616 11.361 12.5384 11.361 15.087 9.91697L22 6" stroke="currentColor" stroke-linejoin="round" stroke-width="1.5"></path><path d="M2.01577 13.4756C2.08114 16.5412 2.11383 18.0739 3.24496 19.2094C4.37608 20.3448 5.95033 20.3843 9.09883 20.4634C11.0393 20.5122 12.9607 20.5122 14.9012 20.4634C18.0497 20.3843 19.6239 20.3448 20.7551 19.2094C21.8862 18.0739 21.9189 16.5412 21.9842 13.4756C22.0053 12.4899 22.0053 11.5101 21.9842 10.5244C21.9189 7.45886 21.8862 5.92609 20.7551 4.79066C19.6239 3.65523 18.0497 3.61568 14.9012 3.53657C12.9607 3.48781 11.0393 3.48781 9.09882 3.53656C5.95033 3.61566 4.37608 3.65521 3.24495 4.79065C2.11382 5.92608 2.08114 7.45885 2.01576 10.5244C1.99474 11.5101 1.99475 12.4899 2.01577 13.4756Z" stroke="currentColor" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg>
  Send Email
</button>

States

html
<button class="vt-btn vt-btn-primary" disabled="">
  Disabled
</button>
<button disabled="" class="vt-btn vt-btn-primary vt-opacity-80 vt-cursor-wait">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4 vt-animate-spin" aria-hidden="true">
    <path d="M21.9961 12C21.9961 17.5228 17.5189 22 11.9961 22C6.47325 22 1.99609 17.5228 1.99609 12C1.99609 6.47715 6.47325 2 11.9961 2" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path>
  </svg>
  <span>Loading...</span>
</button>
<button class="vt-btn vt-btn-bordered" disabled="">
  Disabled
</button>

Full Width

Button that stretches to fill its container.

html
<button class="vt-btn vt-btn-primary vt-w-full">
  Sign In
</button>
<button class="vt-btn vt-btn-bordered vt-w-full">
  Create Account
</button>

Icon Only

Buttons that contain only an icon, used for compact actions and toolbars.

html

Primary

Secondary

Bordered

Ghost

Danger

<div class="vt-text-center">
  <button class="vt-btn vt-btn-primary vt-btn-icon" aria-label="Edit">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M6 22V13.6944C6 12.1287 6 11.3459 6.21454 10.6077C6.42908 9.86948 6.84589 9.21812 7.6795 7.91542L10.3359 3.76419C11.0885 2.58806 11.4648 2 12 2C12.5352 2 12.9115 2.58806 13.6641 3.76419L16.3205 7.91542C17.1541 9.21812 17.5709 9.86948 17.7855 10.6077C18 11.3459 18 12.1287 18 13.6944V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 11C7.63152 11.3231 8.4887 11.9732 9.28009 11.9991C10.2988 12.0324 10.9868 11.1372 12 11.1372C13.0132 11.1372 13.7012 12.0324 14.7199 11.9991C15.5113 11.9732 16.3685 11.3231 17 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 12L12 22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 5H14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">Primary</p>
</div>

<div class="vt-text-center">
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Edit">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M6 22V13.6944C6 12.1287 6 11.3459 6.21454 10.6077C6.42908 9.86948 6.84589 9.21812 7.6795 7.91542L10.3359 3.76419C11.0885 2.58806 11.4648 2 12 2C12.5352 2 12.9115 2.58806 13.6641 3.76419L16.3205 7.91542C17.1541 9.21812 17.5709 9.86948 17.7855 10.6077C18 11.3459 18 12.1287 18 13.6944V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 11C7.63152 11.3231 8.4887 11.9732 9.28009 11.9991C10.2988 12.0324 10.9868 11.1372 12 11.1372C13.0132 11.1372 13.7012 12.0324 14.7199 11.9991C15.5113 11.9732 16.3685 11.3231 17 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 12L12 22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 5H14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">Secondary</p>
</div>

<div class="vt-text-center">
  <button class="vt-btn vt-btn-bordered vt-btn-icon" aria-label="Edit">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M6 22V13.6944C6 12.1287 6 11.3459 6.21454 10.6077C6.42908 9.86948 6.84589 9.21812 7.6795 7.91542L10.3359 3.76419C11.0885 2.58806 11.4648 2 12 2C12.5352 2 12.9115 2.58806 13.6641 3.76419L16.3205 7.91542C17.1541 9.21812 17.5709 9.86948 17.7855 10.6077C18 11.3459 18 12.1287 18 13.6944V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 11C7.63152 11.3231 8.4887 11.9732 9.28009 11.9991C10.2988 12.0324 10.9868 11.1372 12 11.1372C13.0132 11.1372 13.7012 12.0324 14.7199 11.9991C15.5113 11.9732 16.3685 11.3231 17 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 12L12 22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 5H14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">Bordered</p>
</div>

<div class="vt-text-center">
  <button class="vt-btn vt-btn-ghost vt-btn-icon" aria-label="Edit">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M6 22V13.6944C6 12.1287 6 11.3459 6.21454 10.6077C6.42908 9.86948 6.84589 9.21812 7.6795 7.91542L10.3359 3.76419C11.0885 2.58806 11.4648 2 12 2C12.5352 2 12.9115 2.58806 13.6641 3.76419L16.3205 7.91542C17.1541 9.21812 17.5709 9.86948 17.7855 10.6077C18 11.3459 18 12.1287 18 13.6944V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 11C7.63152 11.3231 8.4887 11.9732 9.28009 11.9991C10.2988 12.0324 10.9868 11.1372 12 11.1372C13.0132 11.1372 13.7012 12.0324 14.7199 11.9991C15.5113 11.9732 16.3685 11.3231 17 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 12L12 22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 5H14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">Ghost</p>
</div>

<div class="vt-text-center">
  <button class="vt-btn vt-btn-danger vt-btn-icon" aria-label="Delete">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M18.8516 16.3743L19.5 6H4.5L5.14839 16.3743C5.315 19.0401 5.39831 20.373 6.26426 21.1865C7.13021 22 8.46571 22 11.1367 22H12.8633C15.5343 22 16.8698 22 17.7357 21.1865C18.6017 20.373 18.685 19.0401 18.8516 16.3743Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16 6H21M16 6L15.3778 4.34082C15.0007 3.33524 14.8122 2.83245 14.4402 2.50292C14.3213 2.39765 14.1904 2.3069 14.0501 2.2326C13.6109 2 13.074 2 12 2C10.926 2 10.3891 2 9.9499 2.2326C9.8096 2.3069 9.67865 2.39765 9.55982 2.50292C9.18783 2.83245 8.99928 3.33524 8.62219 4.34082L8 6M16 6H8M3 6H8" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M9.5 11V17M14.5 11V17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">Danger</p>
</div>

Icon Sizes

Icon buttons in small, default, and large sizes — the corner follows the size, like the text buttons.

html

sm

md

lg

<div class="vt-text-center">
  <button class="vt-btn vt-btn-primary vt-btn-icon vt-btn-sm" aria-label="Add">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-3.5 vt-h-3.5" aria-hidden="true">
      <path d="M11.9922 4.00012V20.0001M19.9922 12.0001H3.99222" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">sm</p>
</div>
<div class="vt-text-center">
  <button class="vt-btn vt-btn-primary vt-btn-icon" aria-label="Add">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-4 vt-h-4" aria-hidden="true">
      <path d="M11.9922 4.00012V20.0001M19.9922 12.0001H3.99222" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">md</p>
</div>
<div class="vt-text-center">
  <button class="vt-btn vt-btn-primary vt-btn-icon vt-btn-lg" aria-label="Add">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-5 vt-h-5" aria-hidden="true">
      <path d="M11.9922 4.00012V20.0001M19.9922 12.0001H3.99222" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
  </button>
  <p class="vt-caption vt-text-foreground-muted vt-mt-2">lg</p>
</div>

Guidelines

Do Use one primary button per view; give secondary actions lower emphasis with bordered or ghost.
Don't Don't place multiple primary buttons competing for the same attention.

Read our documentation to get started.

Do For inline navigation inside text, use a link — not a button.

Read our to get started.

Don't Don't drop a button into a sentence to act as a text link.

API Reference

Class Type Description
vt-btn Base Base button styles — flex, rounded, font, transition
vt-btn-primary Variant Brand fill, on-brand text — primary actions
vt-btn-secondary Variant Muted fill — secondary actions
vt-btn-bordered Variant Outline only, no fill
vt-btn-danger Variant Red fill — destructive actions
vt-btn-ghost Variant Transparent, secondary text, subtle hover background — the one quiet button, for any low-emphasis action
vt-btn-sm Size Small button (32px height, text-xs, radius-sm)
vt-btn-lg Size Large button (48px height, radius-lg)
vt-btn-xl Size Extra-large button (56px height, text-base, radius-xl)
vt-active State A button whose menu or panel is open, or the one picked in a toolbar: it looks pressed, with the pressed fill of its variant (State=Pressed in Figma — there is no separate Active). An open menu trigger gets the same look from aria-expanded="true", which the dropdown sets
vt-btn-icon Modifier Square aspect ratio for icon-only buttons
disabled State HTML attribute — reduced opacity, no pointer events

Accessibility

Feature Details
Role Use <button> for actions, <a> for navigation
Keyboard Enter and Space activate the button
Focus Visible focus ring via :focus-visible
Disabled Use disabled attribute — removes from tab order automatically
Icon-only Add aria-label to describe the action when there is no visible text