Create

General

Button Group

Copy page View as Markdown Open in ChatGPT Open in Claude

A container that groups related buttons together with consistent styling.

Usage#

app.component.ts
import { WDS_BUTTON_GROUP } from '@wds/angular/button-group';

Examples#

Default#

Nested groups sit next to each other with a gap; items inside a group share corners and borders.

Archive Report Snooze Mark as read Archive Trash

Orientation#

orientation="vertical" stacks the buttons.

Size#

The group takes the size of its buttons.

Small Button Group Default Button Group Large Button Group

Nested#

1 2 3

Separator#

wds-button-group-separator draws a line between buttons without a border, e.g. secondary.

Copy Paste

Split#

Button

Input#

Input group#

A wds-dropdown trigger joins the group like a button.

Follow Mute conversation Mark as read Block user

Text#

wds-button-group-text looks like an item of the group, e.g. a prefix.

https:// .com

API References#

wds-button-group#

Buttons (and fields) joined into one element: shared corners and one border between neighbors. Nested groups sit next to each other with a gap.

Attributes

AttributeTypeDefaultDescription
orientationWdsButtonGroupOrientation'horizontal'Layout of the group: in a row or in a column.

Slots

SlotDescription
(default)wds-button, wds-input, wds-input-group, wds-dropdown, wds-button-group-text, wds-button-group-separator, nested wds-button-group.

wds-button-group-separator#

A line between items of a group (e.g. for buttons without a border). Vertical by default (for a horizontal group); in a vertical group set orientation="horizontal".

Attributes

AttributeTypeDefaultDescription
orientation'horizontal' | 'vertical''vertical'Direction of the line.

wds-button-group-text#

Text (or an icon) that looks like an item of the group, e.g. an https:// prefix before a field.

Slots

SlotDescription
(default)Text, <svg> icon.

CSS parts (::part)

PartDescription
baseThe box with the padding, border and background.

Accessibility#

Screen reader#

wds-button-group has role="group": give it a name with aria-label that says what the buttons do together. A nested group is also a group; name it when the name adds information.

Buttons and fields in the group keep their own roles and names; an icon-only wds-button needs a label.

wds-button-group-separator has role="separator" with aria-orientation. wds-button-group-text is plain text.

Keyboard support#

The group has no keyboard interaction of its own: each button and field is a separate stop in the page tab sequence.

Footer