Open in Playroom

Accessibility

Follows the WAI-ARIA Button Pattern.Given the button contains only an icon (i.e. no text content), it is required that a label be provided. This will be both announced to a screen reader and presented visually using a TooltipRenderer.

Variants

The button appearance can be customised via the variant prop, which accepts either soft, solid or transparent.
TRANSPARENT
SOFT
SOLID
Open in Playroom

Tones

By default, the button adopts the neutral tone. Actions can be emphasised by setting the tone prop to formAccent, or to brandAccent for the most important actions.
NEUTRAL
FORMACCENT
BRANDACCENT
Open in Playroom

Impact of variant on tone

By default, a button has a neutral tone and uses the soft variant, allowing the visual prominence to be increased or decreased as required.This enables colour to be applied as accents and with purpose, rather than by default — improving the management of user attention and supporting a more declarative hierarchy of actions.
Default is a neutral tone and soft variant
To compliment this, when an accent tone is applied to a button, the default variant becomes solid to maximise its impact — allowing the visual prominence to be reduced as needed.
Default variant becomes solid when an accent tone is applied

Size

The button size can be customised via the size prop, which accepts either small, standard (default) or large.
SMALL
STANDARD
LARGE
Open in Playroom

Custom icons

Product-specific icons can be passed to the icon slot using IconRenderer. See Using custom icons for guidance on sizing, colour and accessibility.
Open in Playroom

Tooltip Placement

By default, the label is presented as a tooltip on top of the button. However, this can be configured via the tooltipPlacement prop, which accepts either top or bottom. See TooltipRenderer for more information.
TOP
BOTTOM
Open in Playroom

Bleed

The bleed prop allows the background colour to bleed out into the surrounding layout — leaving the button to only take up the space required for the icon itself.
BLEED

Heading

NO BLEED

Heading

Open in Playroom

Loading state

You can indicate a loading state inline with the loading prop, which also ensures that the button is disabled.
Open in Playroom

Data attributes

Braid components are very explicit about the properties they accept, which makes providing arbitrary data attributes not possible. Instead, a data prop can be provided as a single collection of data attributes.
<ButtonIcon
  data={{ testid: 'button-icon-1' }}
  // => data-testid="button-icon-1"
/>

Alternatives

  • Button For a semantic button.
  • ButtonLink For a semantic link that looks like a button.