<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5HGSQD2L" height="0" width="0" style="display:none;visibility:hidden" title="GTM"></iframe>

Button

Used to trigger an in-page action such as submitting a form or showing/hiding an interface component.
styleKeys: button

Use Button...

  • To trigger an in-page action such as submitting a form or showing/hiding an interface component.

Don't use Button...

  • To link to another page. Use Link instead, or render the Button as a link.

The preview has been updated.

Skin

Use skin to choose a style of button based on the use case. Refer to guidelines on which skin to use.

The preview has been updated.

Size

Use size="mini" to reduce the size of a Button.

The preview has been updated.

Width

Use width="full-width" to grow a Button to fill its container.

The preview has been updated.

Disabled

Use disabled when a Button’s action is unavailable. Refer to guidelines.

The preview has been updated.

Icons

An Icon can be placed inside Buttons. Use buttonShape="round" for icon only buttons. Use objectFit to accommodate different sized custom icons.

The preview has been updated.

Spinner

A Spinner can be placed inside a disabled Button to show that an action is still in progress. Use a size tiny Spinner for this.
You can also set the Spinner position by adding the iconPosition prop on the Button.

The preview has been updated.

Design Path

Use specialVariant="design-path" for Buttons in the design path flow that require a second line for a description.

The preview has been updated.

Clear Selection

Use skin="clear-selection" for Buttons that show user selections.

The preview has been updated.

Use render for Buttons with the behavior of a Link. Refer to render prop guidelines.

The preview has been updated.

Use render for Links with the behavior of a Button. Refer to render prop guidelines.

The preview has been updated.

Unstyled

Use skin="unstyled" for Buttons with no styling.

The preview has been updated.

Buttons in Banner

When used inside Banner, Buttons have a different styling to make them more neutral. This allows them to sit on a wide range of colors often used as Banner backgrounds without clashing.

The preview has been updated.

Skin

  • Use secondary for all Buttons by default. Multiple secondary actions can be displayed on a page.
  • Use primary for the main action of the page.
    • Limit to a single primary Button per page if possible to guide users through the purchasing flow and help them easily get to the cart.
    • Multiple primary buttons can be used for upsell (adding extra items to checkout).
  • Use tertiary when a more subtle Button is required.

Content

  • Use clear, concise labels to describe the action being performed by the Button.
  • Use sentence case.
  • Do not use punctuation.
  • Buttons will grow wide enough to accommodate their content. If there is not enough room for the Button to grow, the text will wrap to the next line.

Placement

  • Place Buttons in flow near relevant content, with negative space to call the maximum amount of attention to the action.
  • Align Buttons accordingly with the content grouping for visual consistency. For example, left-aligned typography includes a left-aligned Button.

Disabled

  • Disabling Buttons can confuse users since they afford little feedback. Users may not understand why the Button can’t be clicked, and be blocked progressing through the flow. It is often better to allow a Button to be clicked, then communicate to the user what is blocking them from progressing.
  • Use Buttons to perform an action on the current page. Use links to take users to a new page.
  • Buttons can be styled to appear as a link. Links can be styled to appear as a Button.

Accessibility

  • Ensure Buttons have appropriate contrast when placed on busy backgrounds.

Props

Button
This component is implemented using the <button /> as the root element. You can utilize the native attributes supported by <button /> tag. The ref is directly assigned to the root element, allowing you to access and manipulate it as needed.
See core props for additional props that can be applied to this component.
proptyperequireddescriptiondefault
width"standard" | "full-width" | "wide" | nullfalse
The width variation
null
size"standard" | "mini" | nullfalse
⚠️ Deprecated - This is deprecated without a replacement.
The size variation
null
skin"link" | "primary" | "secondary" | "unstyled" | "tertiary" | "clear-selection" | nullfalse
The visual style of the Button
secondary
specialVariant"standard" | "design-path" | nullfalse
Variations for special cases
standard
iconPosition"left" | "right" | nullfalse
The position of the icon in the Button
null
buttonShape"standard" | "round" | nullfalse
The shape of the Button
standard
ButtonDescription
This component is implemented using the <span /> as the root element. You can utilize the native attributes supported by <span /> tag. The ref is directly assigned to the root element, allowing you to access and manipulate it as needed.
See core props for additional props that can be applied to this component.
ClearSelectionButtons
This component is implemented using the <div /> as the root element. You can utilize the native attributes supported by <div /> tag. The ref is directly assigned to the root element, allowing you to access and manipulate it as needed.
See core props for additional props that can be applied to this component.
ClearAllButton
This component is implemented using the <button /> as the root element. You can utilize the native attributes supported by <button /> tag. The ref is directly assigned to the root element, allowing you to access and manipulate it as needed.
See core props for additional props that can be applied to this component.

Related

Was this page useful?

Thanks for your feedback!

Feel free to include your name if you wish to have a follow up conversation.


Published: Jan 7, 2022Last updated: Oct 17, 2024