The page navigation is complete. You may now navigate the page content as you wish.
Skip to main content

Button Set

Provides consistent layout and spacing for a set of buttons.

Use a Button Set to ensure a consistent layout when using multiple Buttons in a single row.


More detailed examples and guidance around button alignment, grouping, and organization can be found in the button organization pattern documentation.

How to use this component

The basic invocation requires two or more buttons to be provided as children:

  <Hds::Button @text="Submit" type="submit" />
  <Hds::Button @text="Cancel" @color="secondary" @href="" />

Equal width buttons

If you want to have buttons with equal width, apply a width (via inline style or CSS class) to the ButtonSet container and the argument @isFullWidth=true to the Button components:

<Hds::ButtonSet {{style width="15rem"}}>
  <Hds::Button @text="Save" @isFullWidth={{true}} />
  <Hds::Button @text="Cancel" @color="secondary" @href="" @isFullWidth={{true}} />

With loading state

This technique is useful if you need to show a loading state, to avoid the resizing and shifting of the buttons:

<Hds::ButtonSet {{style width="15rem"}}>
    @icon={{if this.isLoading "loading"}}
    @text={{if this.isLoading "Loading" "Save"}}
    {{on "click" this.toggleIsLoading}}
    {{on "click" this.cancelLoading}}

Component API

This component supports use of ...attributes.