View in Storybook
Anatomy
Tooltip provides more information about the target element it is associated with. It appears onHover or Focus of an element, typically a Button.
- Text: Displays the Tooltip information.
- Description (optional): Additional text to support the tooltip's primary messaging.
- Badge (optional): Used to display keyboard shortcuts.
- Image (optional): A visual aid to help support a Tooltip messaging.
Usage
Tooltip provides greater product UI understanding to our customers in multiple ways. They are also a key element in improving accessibility and further helpful information.
Placement
The direction of the Tooltip correlates to the position of the action it is linked to, depending on its placement on the screen and length of text within the Tooltip.
Pointers
To indicate the placement of a Tooltip, the corner radius is removed to show a subtle point instead of a traditional arrow.
Padding offset
The offset is the distance between the end of the tip and the target. The default value is 8px horizontally and vertically in all placements.
Best practice
Although useful on any text or actionable item, Tooltip needs to be used in a sensible manner to avoid reducing its importance. It needs to;
- Provide useful, additional information or clarification.
- Succinctly describe or expand on the element they point to.
- Be used sparingly. If you’re building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.
- Not be used on any disabled elements as keyboard users would not be able to view its contents.
Do's and Don'ts
Do |
Don't |
---|---|
✅ Make tooltips clear and concise. |
🚫 Include links or other interactive components into a tooltip as these are not accessible. |
✅ Keep tooltips in view until the user focuses away. |
🚫 Use rich text formatting (Bold, Italic) as screen readers will not convery these differences. |
✅ Add to icon buttons and standalone links for greater context. |
🚫 Use tooltips for essential information. |
|
🚫 Repeat the same information in a Tooltip from the element it appears from. |