v1.3.0 28

Chip

Interactive, compact elements for filtering, selections, and tag management.

Interactive Requires: veritheme.js JS init: automatic

Default

html
Default Selected Removable Disabled
<span class="vt-chip">Default</span>
<span class="vt-chip vt-chip-active">
  <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="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="1.5"></path>
  </svg> Selected
</span>
<span class="vt-chip">
  Removable
  <button type="button" class="vt-chip-remove" aria-label="Remove Removable"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true">
      <path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
</span>
<span class="vt-chip vt-opacity-50 vt-cursor-not-allowed">Disabled</span>

Filter Chips

Toggleable chips for filtering content.

html
<div class="vt-flex vt-flex-wrap vt-gap-2" data-vt-chip-group="filter">
  <button class="vt-chip vt-chip-active" data-vt-selected="true">All</button>
  <button class="vt-chip">Design</button>
  <button class="vt-chip">Development</button>
  <button class="vt-chip">Marketing</button>
  <button class="vt-chip">Sales</button>
</div>

With Icons

Chips with leading icons for additional context.

html
Featured Recent v2.0 John Doe
<span class="vt-chip">
  <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 vt-text-warning-fill" aria-hidden="true">
    <path d="M12.7972 2.90494C13.2554 3.57043 13.9479 4.70769 14.6514 6.04507C15.1942 7.07701 15.4657 7.59298 15.8551 7.86959C16.2444 8.14621 16.812 8.2313 17.9472 8.40149C19.5204 8.63736 20.6806 8.89214 21.3467 9.05516C21.735 9.15017 21.9976 9.50036 21.9976 9.9001C21.9976 10.1262 21.9127 10.344 21.7606 10.5113C21.0637 11.2777 20.3487 12.0836 19.4701 12.961C18.605 13.8249 18.1724 14.2569 18.0253 14.7261C17.8781 15.1954 17.9834 15.7792 18.1939 16.9469C18.3735 17.9433 18.5569 19.1306 18.6921 20.4219C18.7528 21.0024 18.2921 21.5 17.7085 21.5C17.6522 21.5 17.5967 21.4962 17.542 21.4824C17.0502 21.3578 15.919 20.7845 14.1246 19.7243C13.0722 19.1025 12.5461 18.7917 11.9993 18.7917C11.4526 18.7917 10.9265 19.1026 9.87427 19.7244C8.08025 20.7845 6.94977 21.3578 6.45797 21.4824C6.40334 21.4962 6.34784 21.5 6.29148 21.5C5.70788 21.5 5.24716 21.0024 5.30793 20.4219C5.44314 19.1306 5.6265 17.9433 5.80612 16.9469C6.01661 15.7792 6.12186 15.1954 5.97471 14.7261C5.82756 14.2569 5.395 13.8249 4.52987 12.961C3.65132 12.0836 2.93633 11.2777 2.23944 10.5113C2.08729 10.344 2.00244 10.1262 2.00244 9.9001C2.00244 9.50036 2.265 9.15017 2.65328 9.05516C3.31945 8.89214 4.4796 8.63736 6.05284 8.40149C7.18801 8.2313 7.75559 8.14621 8.14498 7.86958C8.53437 7.59295 8.80577 7.07698 9.34859 6.04505C10.0521 4.70768 10.7445 3.57044 11.2026 2.90495C11.3825 2.64364 11.6827 2.5 11.9999 2.5C12.3171 2.5 12.6173 2.64364 12.7972 2.90494Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg> Featured
</span>
<span class="vt-chip">
  <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 vt-text-foreground-muted" aria-hidden="true">
    <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.5"></circle><path d="M12 8V12L14 14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg> Recent
</span>
<span class="vt-chip">
  <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 vt-text-foreground-muted" aria-hidden="true">
    <path d="M8 2H9.01472C10.241 2 10.8541 2 11.4054 2.22836C11.9567 2.45672 12.3903 2.89027 13.2574 3.75736L21.1262 11.6263C21.6841 12.1867 21.9982 12.9449 22 13.7357L22 13.75L22 13.7643C21.9982 14.5551 21.6841 15.3133 21.1262 15.8737L15.8737 21.1262C15.3133 21.6841 14.5551 21.9982 13.7643 22L13.75 22L13.7357 22C12.9449 21.9982 12.1867 21.6841 11.6263 21.1262L3.75736 13.2574C2.89027 12.3903 2.45672 11.9567 2.22836 11.4054C2 10.8541 2 10.241 2 9.01472V8C2 5.17157 2 3.75736 2.87868 2.87868C3.75736 2 5.17157 2 8 2Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7.5 7.25V7.5M8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg> v2.0
</span>
<span class="vt-chip">
  <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 vt-text-foreground-muted" aria-hidden="true">
    <path d="M20 21.0001C19.713 17.269 16.7289 14.3151 12.995 14.0662L12 13.9999C11.6446 14.0096 11.3134 14.0225 11.0008 14.0378C7.3 14.2192 4.28417 17.3057 4 21.0001" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><circle cx="12" cy="6.99988" r="4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
  </svg> John Doe
  <button type="button" class="vt-chip-remove" aria-label="Remove John Doe"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true">
      <path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
</span>

Sizes

Two sizes: vt-chip-sm for tags in a field, and the default.

html
Small Default
<span class="vt-chip vt-chip-sm">Small</span>
<span class="vt-chip">Default</span>

Input Chips

Chips inside an input field for multi-value entry.

html
React TypeScript Astro
<div class="vt-w-full vt-max-w-md">
  <label class="vt-label vt-block vt-mb-2" for="chip-5-1">Technologies</label>
  <div class="vt-combobox-tags">
    <span class="vt-chip vt-chip-sm">
      React
      <button type="button" class="vt-chip-remove" aria-label="Remove React"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true">
          <path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
        </svg></button>
    </span>
    <span class="vt-chip vt-chip-sm">
      TypeScript
      <button type="button" class="vt-chip-remove" aria-label="Remove TypeScript"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true">
          <path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
        </svg></button>
    </span>
    <span class="vt-chip vt-chip-sm">
      Astro
      <button type="button" class="vt-chip-remove" aria-label="Remove Astro"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true">
          <path d="M18 6L12 12M12 12L6 18M12 12L18 18M12 12L6 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
        </svg></button>
    </span>
    <input type="text" placeholder="Add..." aria-label="Add technology" class="vt-combobox-tags-input" id="chip-5-1">
  </div>
</div>

Status Filters

A status filter is a neutral chip with a status dot; selected, it turns brand. A read-only status is a badge.

html
<button type="button" class="vt-chip" aria-pressed="false" onclick="this.classList.toggle('vt-chip-active'); this.setAttribute('aria-pressed', this.classList.contains('vt-chip-active'))">
  <span class="vt-dot vt-dot-sm vt-dot-info" aria-hidden="true"></span> In progress
</button>
<button type="button" class="vt-chip" aria-pressed="false" onclick="this.classList.toggle('vt-chip-active'); this.setAttribute('aria-pressed', this.classList.contains('vt-chip-active'))">
  <span class="vt-dot vt-dot-sm vt-dot-success" aria-hidden="true"></span> Done
</button>
<button type="button" class="vt-chip" aria-pressed="false" onclick="this.classList.toggle('vt-chip-active'); this.setAttribute('aria-pressed', this.classList.contains('vt-chip-active'))">
  <span class="vt-dot vt-dot-sm vt-dot-warning" aria-hidden="true"></span> Blocked
</button>
<button type="button" class="vt-chip" aria-pressed="false" onclick="this.classList.toggle('vt-chip-active'); this.setAttribute('aria-pressed', this.classList.contains('vt-chip-active'))">
  <span class="vt-dot vt-dot-sm vt-dot-danger" aria-hidden="true"></span> Failed
</button>

Guidelines

Do Mark the selected filter with vt-chip-active.
Complete Pending
Don't Don't use chips for read-only status — use a badge.
Design
Do Give removable chips a labeled trailing remove control.
Design
Don't Don't place the remove control before the chip label.

API Reference

Class Type Description
vt-chip Base Selectable token — rounded, bordered, hover state
vt-chip-active State Selected chip — brand-tinted fill and border
vt-chip-sm Size Small chip — 12px label, 2px × 8px padding; tags in a field
aria-disabled="true" State Disabled chip — half opacity, no pointer; works on a tag (span) and a filter chip (button, which may use disabled too)
vt-chip-remove Part Remove button at the end — a 12px X, muted, darkens on hover; give it an aria-label
data-vt-selected Data Selection state hook toggled by the JS bundle

Accessibility

Feature Details
Element Use button for toggleable chips so they are focusable and keyboard-operable
State Toggle chips expose aria-pressed matching the selected state
Removal Removable chips need an aria-label on the remove control, e.g. "Remove Design"