Back to all examples

Button with Icon

<GoabButtonGroup>
      <GoabxButton leadingIcon="arrow-back">Go back</GoabxButton>
      <GoabxButton trailingIcon="arrow-forward">Continue</GoabxButton>
      <GoabxButton type="secondary" leadingIcon="add">Add item</GoabxButton>
    </GoabButtonGroup>
<goab-button-group>
  <goabx-button leadingIcon="arrow-back">Go back</goabx-button>
  <goabx-button trailingIcon="arrow-forward">Continue</goabx-button>
  <goabx-button type="secondary" leadingIcon="add">Add item</goabx-button>
</goab-button-group>
<goa-button-group>
  <goa-button version="2" leadingicon="arrow-back">Go back</goa-button>
  <goa-button version="2" trailingicon="arrow-forward">Continue</goa-button>
  <goa-button version="2" type="secondary" leadingicon="add">Add item</goa-button>
</goa-button-group>

When using icons in buttons, the button text provides the accessible name. The icon is decorative and should be hidden from screen readers with aria-hidden.

Shows how to add leading or trailing icons to buttons for enhanced visual communication.

Use cases

  • Back navigation buttons with arrow icon
  • Add buttons with plus icon
  • Download buttons with download icon
  • External link buttons with external icon

Considerations

  • Keep icon and text semantically aligned
  • Don’t use icons just for decoration
  • Leading icons for actions that “go back” or “add”
  • Trailing icons for actions that “go forward” or “external”