- Ensure messaging is succinct and only use when necessary to provide an explanation for an interface element.
- Use tooltips consistently throughout the page.
- Consider clarifying the design and language if you require lots of tooltips.
- The close icon button and action button are the only available interactive elements.
Tooltip
A tooltip is a contextual message that appears when users interact with an element, providing additional information or guidance.
Dos and Don’ts
- Don’t use tooltips to communicate errors or critical information.
- Do not use tooltips to restate visible UI text.
- Don’t use tooltip for complex interactions or content, use a more appropriate component, such as a popover or modal.
Anatomy
- Title (Optional): Provides overall context of the content.
- Body copy: Provides text information to the user.
- Close icon (Optional): Lets the user dismiss the tooltip.
- Pointer: A visual link between the tooltip container and the trigger element.
- Button (Optional): A button to outline the user’s next options.
Variants
Ensure the correct variation of the tooltip is used depending on the background content to ensure enough contrast.
Default
Used on light backgrounds or containers.
Inverse
Used on dark backgrounds or containers.
Modifiers
Placement
A tooltip can open at the top, bottom, left or right depending on the position of the UI trigger on the screen. In addition, we can select the alignment to the associated UI element. The UI element can be aligned to the start, centre or end of the tooltip container depending on the space available.
By default, the tooltip opens from the bottom position.
- Ensure tooltips are clearly positioned in relation to their trigger or related content.
- Avoid placing a tooltip over any important information.
- Avoid placing a tooltip over any navigation.
- Avoid the tooltip extending off the page and getting cropped.
Title
The title can be removed where it is not necessary.
Action
Tooltips can offer a single action through the use of a button.
Close
For tooltips that need to be closed manually.
Sizes
Width
Predefined
By default, tooltips have a fixed width of 280px and are not dynamic with the content or container.
Fit to content
The width of the container is dynamic to the width of the content and retains 12px left and right padding if there is no close icon, and 8px to the right if there is a close icon.
Fill container
The width is 100% of the container of the UI trigger. It can only be applied to top and bottom tooltips.
Placement
Offset
By default the tooltip has 4px offset between the pointer and the associated UI element. User can override the offset if needed.
Behaviours
Trigger
A trigger can be any UI element, such as a standalone icon, icon button or text.
- Tooltips are triggered by hovering or tabbing (on desktop) or tapping (on tablet and mobile) the trigger element.
- Tooltips can also be triggered automatically by the system, without any manual input from the user.
Auto-dismiss
When close icon or button is not shown, the tooltip will disappear when user hover away from the associated UI element.
Persistent
If the tooltip includes a close icon or button, the tooltip can remain persistent until the user manually dismisses it or taps outside of the tooltip.
Only one tooltip at a time
When a new tooltip is triggered, the previous one is dismissed, even if the tooltips are persistent.
Interactions
Close
A tooltip can be closed in one of three ways: by hovering away from the trigger, or alternatively by clicking/tapping on the close icon or outside the tooltip.
Action
An action button in a tooltip should provide a simple, contextual action that directly relates to the tooltip’s purpose. It should not contain additional links or essential information. For more complex interactions or content, use a more appropriate component, such as a popover or modal.
Content
- All content should use sentence case.
- Tooltip message should be brief, always using clear and concise phrasing.
- Should not contain crucial information. Important information should always be visible, not hidden in tooltips.
Overflow
If the content exceeds the available width, the title and body copy wrap to a new line. Content will be left aligned. Keep the title within 1-2 lines and the body copy to a maximum of 4 lines.
Examples
LTR examples
Here are some examples of the component in left-to-right context:
RTL examples
Here are some examples of the component in right-to-left context: