Skip to main content

ButtonGroup

Displays multiple buttons in a layout.

Anchor to accessibilityLabel
accessibilityLabel
string

Label for the button group that describes the content of the group for screen reader users to understand what's included.

"base" | "none"
Default: 'base'

The gap between elements.

Anchor to children
children
HTMLElement

The content of the ButtonGroup.

Anchor to primary-action
primary-action
HTMLElement

The primary action button for the group. Accepts a single Button element with a variant of primary. Cannot be used when gap="none".

Anchor to secondary-actions
secondary-actions
HTMLElement

Secondary action buttons for the group. Accepts Button or PressButton elements with a variant of secondary or auto.

Examples
<s-button-group>
<s-button slot="primary-action">Save</s-button>
<s-button slot="secondary-actions">Cancel</s-button>
</s-button-group>

Preview

  • Accessing related actions in a consistent layout
  • Making secondary actions visible alongside primary actions

  • Group together related calls to action
  • Avoid too many actions that may cause uncertainty
  • Consider how buttons will work on small screens
Was this page helpful?