v1.3.0 28

Checkbox

A control that allows the user to toggle between checked and not checked.

Default

html
<div class="vt-checkbox" onclick="this.classList.toggle('checked')">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
    <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
  </svg>
</div>
<div class="vt-checkbox checked" onclick="this.classList.toggle('checked')">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
    <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
  </svg>
</div>

Sizes

Three sizes; the corner grows with the box — radius 2xs, xs and sm.

html
<div class="vt-flex vt-items-center vt-gap-3">
  <div class="vt-checkbox" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  <div class="vt-checkbox checked" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
</div><div class="vt-flex vt-items-center vt-gap-3">
  <div class="vt-checkbox vt-checkbox-md" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  <div class="vt-checkbox checked vt-checkbox-md" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
</div><div class="vt-flex vt-items-center vt-gap-3">
  <div class="vt-checkbox vt-checkbox-lg" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  <div class="vt-checkbox checked vt-checkbox-lg" onclick="this.classList.toggle('checked')">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
</div>

With Label

html
<label class="vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked')">
  <div class="vt-checkbox checked">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  <span class="vt-check-label-content">
    <span class="vt-check-label-title">Accept terms and conditions</span>
    <span class="vt-check-label-description">You agree to our Terms of Service and Privacy Policy.</span>
  </span>
</label>

<label class="vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked')">
  <div class="vt-checkbox">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  <span class="vt-check-label-content">
    <span class="vt-check-label-title">Marketing emails</span>
    <span class="vt-check-label-description">Receive emails about new products and features.</span>
  </span>
</label>

Disabled

html
<label class="vt-check-label">
  <div class="vt-checkbox disabled">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  Unchecked disabled
</label>
<label class="vt-check-label">
  <div class="vt-checkbox checked disabled">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
      <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
    </svg>
  </div>
  Checked disabled
</label>

Checklist

Checkboxes used in a to-do list context.

html

Tasks

Your daily checklist.

<div class="vt-card vt-card-sm vt-max-w-md">
  <div class="vt-card-header">
    <h3 class="vt-card-title">Tasks</h3>
    <p class="vt-card-description">Your daily checklist.</p>
  </div>
  <div class="vt-divide-y vt-divide-border-default">
    <label class="vt-list-item vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked'); this.querySelector('.task-text').classList.toggle('vt-line-through'); this.querySelector('.task-text').classList.toggle('vt-text-foreground-muted')">
      <div class="vt-checkbox checked">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
          <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
        </svg>
      </div>
      <span class="task-text vt-line-through vt-text-foreground-muted">Design the homepage</span>
    </label>
    <label class="vt-list-item vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked'); this.querySelector('.task-text').classList.toggle('vt-line-through'); this.querySelector('.task-text').classList.toggle('vt-text-foreground-muted')">
      <div class="vt-checkbox checked">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
          <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
        </svg>
      </div>
      <span class="task-text vt-line-through vt-text-foreground-muted">Create components</span>
    </label>
    <label class="vt-list-item vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked'); this.querySelector('.task-text').classList.toggle('vt-line-through'); this.querySelector('.task-text').classList.toggle('vt-text-foreground-muted')">
      <div class="vt-checkbox">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
          <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
        </svg>
      </div>
      <span class="task-text">Write documentation</span>
    </label>
    <label class="vt-list-item vt-check-label" onclick="this.querySelector('.vt-checkbox').classList.toggle('checked'); this.querySelector('.task-text').classList.toggle('vt-line-through'); this.querySelector('.task-text').classList.toggle('vt-text-foreground-muted')">
      <div class="vt-checkbox">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="check-icon vt-w-3 vt-h-3" aria-hidden="true">
          <path d="M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17 9.00004 17C9.41425 17 9.74759 16.6523 10.4143 15.9568L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"></path>
        </svg>
      </div>
      <span class="task-text">Deploy to production</span>
    </label>
  </div>
</div>

Guidelines

Do Use checkboxes for multiple independent yes/no choices.
Don't Don't use checkboxes for mutually exclusive options — use radio.
Do Always pair a checkbox with a clickable label.
Don't Don't leave a checkbox floating without any label.

API Reference

Class Type Description
vt-checkbox Base Base checkbox container with border and background
vt-checkbox-md Size Medium — 20px box, radius-xs (6px)
vt-checkbox-lg Size Large — 24px box, radius-sm (8px); the default is 16px with radius-2xs (4px)
checked State Checked state — shows checkmark icon
disabled State Disabled state — reduced opacity, no pointer events
check-icon Icon SVG checkmark icon that appears when checked
vt-check-label Component Clickable row of a checkbox and its text (Body/SM), 12px apart
vt-check-label-content Part Stacks a title and a description; the row then aligns to the top
vt-check-label-title Part Title in Label/MD
vt-check-label-description Part Hint under the title — Body/SM, muted
vt-disabled State On vt-check-label: grays the text; automatic when the control is .disabled or :disabled

Accessibility

Feature Details
Native Input Use native <input type="checkbox"> with custom styling for best accessibility
Label Always associate with a label via for/id or wrapping label element
Keyboard Space toggles the checkbox, focus ring is visible
ARIA Use aria-checked for custom checkboxes, role="checkbox" if not using native input
Disabled Use disabled attribute to remove from tab order