Overview

Overview

Buttons are an interactive element that initiates an action, such as submitting a form or opening a page.

Buttons are typically used to trigger an action, such as submitting a form, opening a menu, or initiating a search. They can also be used to navigate between pages or sections of a website or app. The use of consistent button styles helps to create a cohesive user experience and reduce cognitive load for users.

Our Design System has 3 types of buttons, primary, secondary and tertiary.

Primary buttons

These buttons are designed to be the most prominent and visually distinct on a page or within a user interface. Primary buttons are typically used to indicate the primary action that a user is intended to take, such as submitting a form, initiating a purchase, or creating a new account.

Vanilla example
Palette
<ul class="qld__link-list qld__link-list--inline"> <!-- Link button --> <li><a href="#" class="qld__btn" hover="">Link</a></li> <!-- Default button --> <li><button type="button" class="qld__btn">Default</button></li> <!-- Leading icon --> <li> <button type="button" class="qld__btn qld__btn--icon-lead"> <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> Leading icon </button> </li> <!-- Trailing icon --> <li> <button type="button" class="qld__btn qld__btn--icon-trail">Trailing icon <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> </button> </li> <!-- Disabled --> <li><button type="button" class="qld__btn" disabled="">Disabled</button></li> </ul>

Usage guidelines

They should always be used for the most important action on the screen. Primary buttons should be used when the user performs an action, and should describe what happens when pressed.

Primary buttons should be for call-to-actions and are not intended as tools to navigating users to different pages or to another part within the same page, use a text link instead for these situations (Digital NSW, n.d.).

How to use

Primary buttons are a strongest button style and should be only used once on the page. Too many primary buttons can increase cognitive load because people must spend time comparing multiple likely options before making a choice (Apple Inc., 2022).

Do not assign a destructive action as the primary role to this button, even if it seems like the most logical choice. People tend to select primary buttons without reading the label, so this could lead to accidentally losing content. Instead, assign the primary role to a nondestructive button to prevent this from happening (Google, 2022).

Secondary buttons

Secondary buttons are used to provide a visual hierarchy and allow users to perform secondary or less important actions. These buttons use an outlined style which is lower in visual weight in contrast compared to the primary button.

Vanilla example
Palette
<ul class="qld__link-list qld__link-list--inline"> <!-- Link button --> <li><a href="#" class="qld__btn qld__btn--secondary" hover="">Link</a></li> <!-- Default button --> <li><button type="button" class="qld__btn qld__btn--secondary">Default</button></li> <!-- Leading icon --> <li> <button type="button" class="qld__btn qld__btn--secondary qld__btn--icon-lead"> <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> Leading icon </button> </li> <!-- Trailing icon --> <li> <button type="button" class="qld__btn qld__btn--secondary qld__btn--icon-trail"> Trailing icon <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> </button> </li> <!-- Disabled --> <li><button type="button" class="qld__btn qld__btn--secondary" disabled="">Disabled</button></li> </ul>

Usage guidelines

Use Secondary Buttons for Less Important Actions: Secondary buttons should be used for actions that are less important than the primary action, but still relevant (Google, 2022).

Tertiary buttons

Tertiary buttons provide users with a third option action that is less important than the primary and secondary actions. They're smaller and less visually prominent than primary and secondary buttons and are typically used in situations where a third option is needed.

Vanilla example
Palette
<ul class="qld__link-list qld__link-list--inline"> <!-- Link button --> <li><a href="#" class="qld__btn qld__btn--tertiary" hover="">Link</a></li> <!-- Default button --> <li><button type="button" class="qld__btn qld__btn--tertiary">Default</button></li> <!-- Leading icon --> <li> <button type="button" class="qld__btn qld__btn--tertiary qld__btn--icon-lead"> <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> Leading icon </button> </li> <!-- Trailing icon --> <li> <button type="button" class="qld__btn qld__btn--tertiary qld__btn--icon-trail"> Trailing icon <svg class="qld__icon qld__icon--sm" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="https://www.designsystem.qld.gov.au/__data/assets/git_bridge/0027/169317/dist/mysource_files/img/QLD-icons.svg#announcement"></use></svg> </button> </li> <!-- Disabled --> <li><button type="button" class="qld__btn qld__btn--tertiary" disabled="">Disabled</button></li> </ul>

Usage guidelines

Tertiary buttons should be used sparingly and only when necessary to avoid cluttering the user interface and confusing the user.

They can be used as a "cancel" or "back" option in a multi-step process, to display a help menu or provide links to related content. Typically, it performs the opposite action to the secondary button (e.g. Cancel vs Save).

General usage guidelines for buttons

Use the appropriate button component for the appropriate action. Using the wrong button can lead to confusion and frustration for the user.

When to use

Buttons are commonly used to encourage users to take an action, such as "Submit" or "Register".

When not to use

Do not use buttons in place of text links for simple navigation or for linking to external content. Buttons should only be used when a more prominent call-to-action is needed.

How to use

Do

  • Label buttons with what they do for users. The button should clearly show users what will happen when they click it. Use action words to describe the task, like ‘Create account’ for a button that lets users sign up. This way, users know what to expect after clicking the button.
  • Put buttons where users can easily find them.
  • Make the most important button look like it’s the most important one, try to use only one primary action button on a page so that it clearly stands out.

Do not:

  • Do not overuse buttons for links as makes them less noticeable.

Guidelines for using icons in buttons

Our buttons can include icons next to text labels to both clarify an action and call attention to a button. These icons either be trailing icons placed after the label or leading icons.

Guidelines for leading icons

  • Use when the action or content is closely associated with the icon, and when the icon helps to reinforce the meaning of the label
  • Place the icon to the left of the label to provide visual cues for users to scan and recognise the action or content
  • Use simple, recognisable icons that are easy to understand

Guidelines for trailing icons

  • Use when the action or content is not closely associated with the icon, and when the icon provides additional information or context
  • Place the icon to the right of the label to avoid distracting users from the label text
  • Use subtle, low-contrast icons that do not compete with the label text
  • When the icon is directing the user to an action like an external page

Don't place both a leading and a trailing icon (Google, 2022).