For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/button-group.md.

Button Group

A row or column of connected buttons that reads as one toolbar, where each button runs its own action. With a glass variant, the buttons share one Liquid Glass background, as iOS groups toolbar items.

Installation

npx @blotch/dolan add button-group
import {
  UiButtonGroup,
  UiButtonGroupItem,
} from '../components/ui/button-group';

This also adds Glass, which draws the glass variants, and Icon. Button Group imports class-variance-authority (see Installation).

Usage

src/app/app.ts
import { Component } from '@angular/core';
import {
  UiButtonGroup,
  UiButtonGroupItem,
} from '../components/ui/button-group';

@Component({
  selector: 'app-root',
  imports: [UiButtonGroup, UiButtonGroupItem],
  template: `
    <ui-button-group>
      <ui-button-group-item (pressed)="copy()">Copy</ui-button-group-item>
      <ui-button-group-item (pressed)="paste()">Paste</ui-button-group-item>
    </ui-button-group>
  `,
})
export class App {
  protected copy(): void {}
  protected paste(): void {}
}
  • The group sets the look of every item. Each item emits its own pressed.
  • Nothing stays selected. For buttons that stay on, use a toggle group from Toggle.
  • The group hugs its items. Add class="w-full" to stretch it.

Variants

<ui-button-group variant="default">…</ui-button-group>
<ui-button-group variant="outline">…</ui-button-group>

default fills the items with the secondary color. outline uses the background color inside a border.

Glass

One glass background for a group of actions that floats over your content, like a toolbar on iOS 26:

<ui-button-group variant="glass" size="icon">
  <ui-button-group-item accessibility-label="Undo" (pressed)="undo()">
    <ui-icon name="undo-2" />
  </ui-button-group-item>
  <ui-button-group-item accessibility-label="Redo" (pressed)="redo()">
    <ui-icon name="redo-2" />
  </ui-button-group-item>
  <ui-button-group-item accessibility-label="Share" (pressed)="share()">
    <ui-icon name="share-2" />
  </ui-button-group-item>
</ui-button-group>
  • glass is regular glass. glass-clear is clear glass for over photos and video, on a dark dimming layer so its white icons stay legible.
  • The group is one glass shape and its items are plain. iOS draws grouped toolbar items this way. Glass circles merged in a glass group would join with pinched waists instead, and glass shouldn't sit on glass.
  • A pressed item lights up in corners concentric with the group's. On iOS 26 the glass also swells under the finger.
  • A row is a capsule. A column is too when its items are icons, and otherwise has round corners.

What each platform draws:

PlatformGlass variants
iOS 26 and laterOne Liquid Glass shape, drawn by iOS
iOS 15 to 25One shape on the thin blur material
AndroidMaterial 3's connected button group: tonal buttons 2px apart, with round outer corners
Android, with provideGlass()One glass shape without the refraction
Web previewOne Liquid Glass shape, drawn with WebGL

Sizes

<ui-button-group size="sm">…</ui-button-group>
<ui-button-group size="default">…</ui-button-group>
<ui-button-group size="lg">…</ui-button-group>
<ui-button-group size="icon">…</ui-button-group>

icon makes square items for one <ui-icon> each. Give each an accessibility-label, which a screen reader says instead. In the other sizes, an icon sits before the label.

Vertical

<ui-button-group orientation="vertical" variant="outline">
  <ui-button-group-item (pressed)="openProfile()">Profile</ui-button-group-item>
  <ui-button-group-item (pressed)="openSettings()">
    Settings
  </ui-button-group-item>
</ui-button-group>

Disabled

<ui-button-group disabled>…</ui-button-group>

<ui-button-group>
  <ui-button-group-item (pressed)="undo()">Undo</ui-button-group-item>
  <ui-button-group-item disabled>Redo</ui-button-group-item>
</ui-button-group>

Disable the whole group, or one item. A disabled item dims and doesn't emit pressed.

API

UiButtonGroup

InputTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Lays the items out in a row or a column.
variant'default' | 'outline' | 'glass' | 'glass-clear''default'Visual style of every item.
size'default' | 'sm' | 'lg' | 'icon''default'Height and padding of every item.
disabledbooleanfalseDisables every item.
classstring''Extra Tailwind classes for the group.

No outputs.

UiButtonGroupItem

InputTypeDefaultDescription
disabledbooleanfalseDisables this item only.
accessibility-labelstring—What a screen reader says. Needed for an icon-only item.
classstring''Extra Tailwind classes for the item.
OutputTypeDescription
pressedvoidEmits on tap, unless the item or group is disabled.

The file also exports buttonGroupItemVariants and the ButtonGroupVariant, SolidButtonGroupVariant, GlassButtonGroupVariant, ButtonGroupLook, ButtonGroupSize and ButtonGroupOrientation types.

Accessibility

  • A screen reader reads each item's label as a button, or its accessibility-label.
  • Reduce Motion: solid items dim while pressed instead of shrinking. Glass and Material items only light up, which isn't motion, and the web preview's glass stops swelling.
  • Reduce Transparency and Increase Contrast: the glass follows them as Glass does. Under Increase Contrast, Android's Material items get an outline.
  • Button: a single button, with glass variants too
  • Glass: the Liquid Glass the glass variants draw
  • Toggle: buttons that stay pressed