v1.3.0 28

Button Group

Buttons side by side as one segmented control — every button keeps its own look; only the corners where they meet are squared.

Default

Buttons joined in a row: touching borders collapse into one, the outer corners stay rounded.

html
<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary"><span>Left</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Center</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Right</span></button>
</div>

With Active State

One button highlighted as the current selection.

html
<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary vt-active"><span>Day</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Week</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Month</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Year</span></button>
</div>

With Icons

Icon-only button group for compact toolbars.

html
<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Bold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M13 4H10C8.11438 4 7.17157 4 6.58579 4.58579C6 5.17157 6 6.11438 6 8V12H13C15.2091 12 17 10.2091 17 8C17 5.79086 15.2091 4 13 4Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14 12H6V16C6 17.8856 6 18.8284 6.58579 19.4142C7.17157 20 8.11438 20 10 20H14C16.2091 20 18 18.2091 18 16C18 13.7909 16.2091 12 14 12Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Italic"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M10.6667 4H20" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path><path d="M7.99872 20L15.9987 4" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path><path d="M3.99872 20L13.3321 20" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path>
    </svg></button>
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Strikethrough"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M3.99219 12H19.9922" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M17.4922 7.66667C17.4922 5.08934 15.0298 3 11.9922 3C8.95462 3 6.49219 5.08934 6.49219 7.66667C6.49219 8.15279 6.54555 8.59783 6.65899 9M5.99219 16.3333C5.99219 18.9107 8.67848 21 11.9922 21C15.3059 21 17.9922 19.6667 17.9922 16.3333C17.9922 13.9404 16.9615 12.5782 14.9001 12" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path>
    </svg></button>
</div>

<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary vt-btn-icon vt-active" aria-label="Align left"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M3 3H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 9H11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 15H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 21H11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Align center"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M3 3H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 9H16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 15H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 21H16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
  <button class="vt-btn vt-btn-secondary vt-btn-icon" aria-label="Align right"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M3 3H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 9H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 15H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 21H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
</div>

Sizes

Small, default, large and extra large groups: the size is set on the group, and every button in it follows.

html
<div class="vt-btn-group vt-btn-group-sm">
  <button class="vt-btn vt-btn-secondary"><span>Small</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Group</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Buttons</span></button>
</div>

<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary"><span>Default</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Group</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Buttons</span></button>
</div>

<div class="vt-btn-group vt-btn-group-lg">
  <button class="vt-btn vt-btn-secondary"><span>Large</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Group</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Buttons</span></button>
</div>

<div class="vt-btn-group vt-btn-group-xl">
  <button class="vt-btn vt-btn-secondary"><span>Extra large</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Group</span></button>
  <button class="vt-btn vt-btn-secondary"><span>Buttons</span></button>
</div>

With Dropdown

Split button with a primary action and a dropdown trigger; inverted groups put a light divider between the two.

html
<div class="vt-btn-group-inverted">
  <button class="vt-btn vt-btn-primary"><span>Save</span></button>
  <button class="vt-btn vt-btn-primary vt-btn-icon" data-split-trigger="split1" aria-label="More options">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" 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>
</div>

<div class="vt-btn-group">
  <button class="vt-btn vt-btn-secondary"><span>Export</span></button>
  <button class="vt-btn vt-btn-secondary vt-btn-icon" data-split-trigger="split2" aria-label="More options">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" 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>
</div>

<div class="vt-btn-group-inverted">
  <button class="vt-btn vt-btn-danger"><span>Delete</span></button>
  <button class="vt-btn vt-btn-danger vt-btn-icon" aria-label="More options">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" 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>
</div>

Vertical

Buttons stacked vertically for sidebar or panel layouts: square where they meet, rounded at the top and bottom.

html
<div class="vt-btn-group-vertical">
  <button class="vt-active">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M13 2L2 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 3V22H7C5.11438 22 4.17157 22 3.58579 21.4142C3 20.8284 3 19.8856 3 18V7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 7L22 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 21.9997H17C18.8856 21.9997 19.8284 21.9997 20.4142 21.4139C21 20.8281 21 19.8853 21 17.9997V11.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M18 10L18 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 11H8M7 15H8" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16 14H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16.5 22V18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
    <span>Overview</span>
  </button>
  <button>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M8 9V17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 5V17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M18 13V17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 3V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg>
    <span>Analytics</span>
  </button>
  <button>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M3.95631 10.5829L3.03254 9.07084C2.74505 8.60024 2.7389 8.00978 3.01652 7.5333L3.63533 6.47124C3.90953 6.00064 4.41721 5.71571 4.96162 5.7269L6.69131 5.76245C6.92616 5.76728 7.15379 5.68727 7.34333 5.54846C7.79531 5.21745 8.28334 4.93276 8.80042 4.70139C9.01191 4.60675 9.19222 4.45165 9.30469 4.24903L10.1203 2.77965C10.3847 2.30328 10.8865 2.00781 11.4312 2.00781H12.6937C13.2384 2.00781 13.7403 2.30329 14.0047 2.77966L14.8202 4.24902C14.9327 4.45165 15.113 4.60675 15.3245 4.70139C15.8416 4.93274 16.3296 5.2174 16.7815 5.54838C16.9711 5.68718 17.1987 5.76718 17.4336 5.76235L19.1634 5.72676C19.7078 5.71557 20.2155 6.00049 20.4897 6.47111L21.1085 7.53314C21.3862 8.00963 21.38 8.60009 21.0925 9.07068L20.1687 10.5828C20.0481 10.7803 20.002 11.0134 20.0235 11.2439C20.0707 11.7486 20.0707 12.267 20.0235 12.7717C20.002 13.0022 20.0481 13.2353 20.1687 13.4329L21.0924 14.9448C21.3799 15.4154 21.3861 16.0058 21.1084 16.4823L20.4896 17.5444C20.2154 18.015 19.7077 18.2999 19.1633 18.2887L17.4338 18.2531C17.1989 18.2483 16.9713 18.3283 16.7817 18.4671C16.3297 18.7982 15.8416 19.0829 15.3245 19.3142C15.113 19.4089 14.9327 19.564 14.8202 19.7666L14.0047 21.236C13.7403 21.7123 13.2384 22.0078 12.6937 22.0078H11.4312C10.8866 22.0078 10.3847 21.7123 10.1203 21.236L9.30468 19.7665C9.19222 19.5639 9.01191 19.4088 8.80042 19.3142C8.28329 19.0828 7.79519 18.798 7.34316 18.467C7.15362 18.3282 6.92597 18.2482 6.69111 18.253L4.96175 18.2886C4.41733 18.2998 3.90963 18.0148 3.63543 17.5442L3.01663 16.4822C2.739 16.0057 2.74515 15.4152 3.03264 14.9446L3.95631 13.4327C4.07699 13.2351 4.12309 13.002 4.10154 12.7715C4.05437 12.267 4.05438 11.7486 4.10154 11.244C4.12308 11.0135 4.07699 10.7805 3.95631 10.5829Z" stroke="currentColor" stroke-width="1.5"></path><circle cx="12.0625" cy="12.0078" r="3.5" stroke="currentColor" stroke-width="1.5"></circle>
    </svg>
    <span>Settings</span>
  </button>
</div>

<div class="vt-btn-group-vertical">
  <button aria-label="List view"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 8H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 12H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 16H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
  <button aria-label="Grid view"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M21.5 12L2.5 12" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path><path d="M12 2.5L12 21.5" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"></path>
    </svg></button>
  <button aria-label="Filters"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" aria-hidden="true">
      <path d="M2.99982 12.0002H10.9998" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13.9998 5.00015L20.9998 5.00015" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M11.9998 19.0002L20.9998 19.0002" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M2.99982 5.00015H9.99982M9.99982 5.00015V3.00015M9.99982 5.00015V7.00015" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M2.99982 19.0002H7.99982M7.99982 19.0002V17.0002M7.99982 19.0002V21.0002" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14.9998 12.0002L20.9998 12.0002M14.9998 12.0002V10.0002M14.9998 12.0002V14.0002" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
    </svg></button>
</div>

Guidelines

Do Use a group for related, mutually exclusive options like a time range.
Don't Don't cram many options into a group — use a select past ~4.
Do Mark the current selection with the active state.
Don't Don't leave a segmented control with no option selected.

Anatomy

The hovered, focused, pressed or vt-active button is lifted above its neighbors, so its border and focus ring are drawn whole.

div.vt-btn-group                         ← Lays the buttons out in a row; draws nothing itself
├── button.vt-btn.vt-btn-primary        ← First: keeps its start corners
├── button.vt-btn.vt-btn-secondary      ← Middle: square corners, pulled back one border width
└── button.vt-btn.vt-btn-secondary      ← Last: keeps its end corners

API Reference

Class Type Description
vt-btn-group Base Sets its vt-btn children side by side. No border, clip or divider of its own: each button keeps its fill, border, shadows and focus ring; corners are squared where buttons meet and touching borders collapse into one
vt-btn-group-inverted Base Split button of primary (or danger) buttons, joined with a light divider between them
vt-btn-group-vertical Base The same, stacked: the first keeps its top corners, the last its bottom ones
vt-btn-group-sm/-lg/-xl Size Sizes the whole group: every button in it — vt-btn or bare <button>/<a> — takes that size (height, padding, type, corners). Without one the group is MD and its buttons keep their own size
vt-active State The chosen button — brand fill, like a primary button

Accessibility

Feature Details
Role Use role="group" with aria-label describing the group purpose
Keyboard Tab moves between groups, arrow keys move within the group
Focus Visible focus ring on each button via :focus-visible
Toggle Active button should have aria-pressed="true" for toggle groups