Button

Android · iOS · Web
Buttons are used to trigger an action, such as submitting a form, navigating to a new page, or triggering a modal window.

Overview

A Button serves as a foundational element in UI that users interact with to perform actions within the product, such as saving progress, submitting forms, or navigating to other areas of the product. Torq offers multiple types of Buttons including primary, secondary, tertiary and quaternary.

Live demo

Appearance
Content
Examples
Modifiers

Usage

Do

  • Use labels that clearly indicate the action the Button will trigger.

  • Use meaningful Icons that help provide additional context to the text.

  • Use the appropriate interactive state to provide visual feedback to the user.

Don't

  • Don’t use Buttons that are too small or have low contrast, making them difficult to click.

  • Avoid using Buttons as a navigational element, use a Link instead.

  • When grouping buttons, don't mix and match button sizes


Placement

The Button component can be placed anywhere on a page where user interaction is required, such as in forms, navigation bars, or call-to-action sections.

For small screens

  • Each Button should use the full width of its container.

  • The Primary Button should be placed at the top, followed by the Secondary and Tertiary Buttons in order.

For large screens

  • Place Buttons in a row, one next to the other.

  • The Primary Button should be placed on the right side of the Button Group.

  • The Secondary Button should be placed to the left of the Primary Button.

  • The Tertiary Button should be placed to the left of the Secondary Button.




Content

  • The Button label is the most important element of the button as it indicates the action that the Button will trigger. It should be clear, concise and predictable.

  • Use no more than 3 words if possible.

  • Use clear and concise text to indicate the action the Button will trigger.

  • Don’t use punctuation marks such as periods or exclamation points.

  • Write labels as verbs.

  • Use sentence case (e.g. Log in, Sign up free, Subscribe, Email us).

  • Don’t use Icons that are not meaningful or don't provide additional context.


Styles

ExampleStyleWhen to use
Primary
  • To call attention to the principal call to action on a page
  • Limit usage to once per page, if possible
  • Not necessary to have a primary button on every screen
Secondary
  • Use for medium emphasis or secondary actions
  • Use primary and secondary buttons in a button group
Tertiary
  • Use for low emphasis to surface less prominent actions, for example carousel (expansive actions, show more)
Quaternary
  • Where possible, use with icon that indicates action, ie. chevron
  • When used without icon, place it in a position next to a secondary button

Size variants

The Button component comes in three size variations: small, medium and large.

The medium size is the default and most frequently used option. Pair Button sizes with form field sizes.

ExampleStateWhen to use
Medium(default)
  • Default, used in majority of instances. When in doubt, use Medium size.
Small
  • Use when there is not enough vertical space for the default or field-sized button.
Large
  • Use large size buttons when suitable for prominent important content on the page.

Width variations

WidthWhen to use
HugDesktop, including modals
Full width (Fill container)Mobile

States and interactions

The Button component has several interactive states, including enabled, hover, active, focus, and disabled.

Each state can be customised with different properties and colour tokens to provide visual feedback to the user.

ExampleStateWhen to use
Enabled
  • The default button state
Hover
  • Indicating user interaction
Focus
  • Indicating accessibility control such as keyboard
Active
  • The state visible the moment the button is clicked or tapped
Disabled
  • Non-interactive state. Shows that a button exists but is not available in that circumstance. See disabled button guidance below.

Disabled Button

  • Exercise caution with Disabled Buttons and consider alternatives, such as enabling Buttons and validating information upon submission, accompanied by clear error information.

  • Disabled Buttons can cause confusion and frustration for users, leading to high abandonment rates and increased support inquiries.

Accessibility

  • Use clear and descriptive labels. Avoid using vague or ambiguous labels that may confuse users.

  • Ensure high colour contrast between the Button and the background.

  • Ensure that users can navigate and interact with the Button using keyboard controls. Test the tab order and focus states.

  • Verify that screen readers properly announce Button text and any associated icons. Include ARIA attributes to enhance accessibility.

  • Provide visual feedback when the Button is clicked. Users should be able to easily see when a Button has focus. Use a clear and distinct focus state, such as a visible outline or change in colour.

  • Test the Button's accessibility on all devices and platforms.

iOS guidance

Along with the guidance above, there is some iOS specific guidance for this component.

  • Adhere to Apple's Human Interface Guidelines (HIG) for iOS design principles and recommendations.

  • Use standard system Buttons provided by iOS to ensure consistency within the iOS ecosystem.

  • Follow iOS guidelines for placing Buttons in toolbars and navigation bars, using standard Button types for these contexts.

  • Provide visual feedback when the Button is clicked. Users should be able to easily see when a Button has focus. Use a clear and distinct focus state, such as a visible outline or change in colour.