Skip to content

ButtonGroup

Button group: combines multiple oas-button elements into a value-selection group; adjacent button corners merge and hover only highlights the current item.

Basic usage

Basic button group

JanuaryFebruaryMarch

Type & size passthrough

type / size are passed through uniformly to all child buttons in the group. size supports five tiers: xs / small / medium (default) / large / xl.

Type & size passthrough

LeftMiddleRightXSXSXSXLXLXL

Single select

Declare the current selection with value; clicking dispatches oas-change with detail: { value }.

Single-select group

Option AOption BOption C

Multiple select

Add multiple to enable multi-select; value uses comma-separated selected values. Clicking dispatches oas-change with detail: { value: [] }.

Multi-select group

Tag ATag BTag C

Accessible name

aria-label gives the button group container an accessible name, letting screen readers announce it as a single focusable group; when unset, the built-in i18n label "button group" is used. When multiple groups exist on a page, use names to distinguish them.

aria-label accessible name

List viewGrid viewExport CSVExport PDF

Vertical

Vertical button group

TopMiddleBottom

Disabled & mixed

disabled disables the whole group; buttons without a value attribute act as regular buttons and don't participate in selection.

Disabled & mixed

DisabledDisabledSaveDeleteMore actions

API

Attributes

AttributeDescriptionTypeDefault
aria-labelGroup container accessible name (defaults to the built-in i18n label)
disabledDisable the whole groupboolean
multipleMulti-select modeboolean
sizeSize passed to child buttonsstring
typeType passed to child buttonsstring
valueSelected value (single value in single-select, comma-separated in multi-select)string
verticalStack vertically, merging corners top/bottom

Events

EventDescription
oas-changeSelection changed. Single-select detail: { value }; multi-select detail: { value: [] }

Slots

NameDescription
default

Note: child buttons declare their selectable value via the value attribute; children without value are regular buttons and don't participate in selection or dispatch oas-change. The selected state is expressed through the child button's aria-pressed; use oas-button[aria-pressed='true'] to customize the selected style.