Button
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
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
| Example | Style | When to use |
|---|---|---|
| Primary |
| |
| Secondary |
| |
| Tertiary |
| |
| Quaternary |
|
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.
| Example | State | When to use |
|---|---|---|
| Medium(default) |
| |
| Small |
| |
| Large |
|
Width variations
| Width | When to use |
|---|---|
| Hug | Desktop, 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.
| Example | State | When to use |
|---|---|---|
| Enabled |
| |
| Hover |
| |
| Focus |
| |
| Active |
| |
| Disabled |
|
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.