Use a button to help users perform an action, such as submitting a form or starting an application.
When to use a button or a link
Button styling can be applied to either button or link elements. Use the appropriate element for the task: use a button element when the user is performing an action, use a link element when the user is navigating.
Try to limit the use of styling link elements to look like buttons, as this may confuse the visual clues for how that element can be interacted with.
Types of button
This is the default button style. Use this for your primary calls to action. Multiple primary buttons can confuse users so try to have only one of these per page (or section of a page).
If a button is used to cancel or back out of an action, this style should be used. This button is typically used alongside a primary button.
All other non-primary actions should use this style. It has less visual prominence than the primary and cancel buttons.
Buttons in a disabled or unclickable state should be visually distinct and use this display.
Disabled buttons can confuse users so only include them if user research shows that they are helpful in your particular use case.
This is the default behaviour with buttons expanding to fit the length of text.
Use fixed-width buttons to force uniformity in button widths. Button labels will wrap onto multiple lines if there is insufficient space.
Use maximum-width buttons for large buttons. These will fill the width of small screens, up to a maximum width of 480px.
A small button style can be used when available space is limited.
The small button modifier can be applied to any button type or width variant.
Buttons with icons
Icons can be added to buttons. Buttons with icons can also have any size, type or width modifiers applied to them.
The icons can be aligned to either side of the button.
Buttons can contain an icon with no visible text. If you do this, make sure that the intention of the button is clearly communicated in a way that is accessible to users of assistive technology.
To track interactions with button elements in Google Analytics using Google Tag Manager, each button has a data attribute that describes the action.
The data attribute is added automatically by the Design System’s ‘tracking’ script.
Standard links do not receive additional tracking attributes so it is recommended to use the button component when linking to both internal and external service start pages to improve analytics data.
Feedback, help or support
If you need any help or want to give any feedback you can e-mail us at: firstname.lastname@example.org