Skip to main content

ButtonGroup

ButtonGroup is used to display multiple buttons in a layout that is contextual based on the screen width or parent component. When there is more than one secondary action, they get collapsed.

string

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

string

A unique identifier for the element.

Was this section helpful?

HTMLElement

The primary action for the group. Accepts a single Button element.

HTMLElement

The secondary actions for the group. Accepts multiple Button elements.

Was this section helpful?

Code

<s-button-group>
<s-button slot="primary-action" variant="primary">
Pay now
</s-button>
<s-button slot="secondary-actions" variant="secondary">
Edit order
</s-button>
<s-button slot="secondary-actions" variant="secondary">
Cancel order
</s-button>
</s-button-group>

Preview

An example of the ButtonGroup component shows a primary action and multiple collapsed secondary actions.