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.
With Active State
One button highlighted as the current selection.
With Icons
Icon-only button group for compact toolbars.
Sizes
Small, default, large and extra large groups: the size is set on the group, and every button in it follows.
With Dropdown
Split button with a primary action and a dropdown trigger; inverted groups put a light divider between the two.
Vertical
Buttons stacked vertically for sidebar or panel layouts: square where they meet, rounded at the top and bottom.
Guidelines
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 |