Skip to main content

Tooltip

A tooltip is a contextual message that appears when users interact with an element, providing additional information or guidance.

Dos and Don’ts

Do
  • 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.
Don't
  • 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

Example of the tooltip component anatomy.
  1. Title (Optional): Provides overall context of the content.
  2. Body copy: Provides text information to the user.
  3. Close icon (Optional): Lets the user dismiss the tooltip.
  4. Pointer: A visual link between the tooltip container and the trigger element.
  5. 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.

Example of the default tooltip variant.

Inverse

Used on dark backgrounds or containers.

Example of the inverse tooltip variant on a solid dark background.
Example of the inverse tooltip variant on a complex background.

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.

Do
  • Ensure tooltips are clearly positioned in relation to their trigger or related content.
Don't
  • 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.

Bottom - start

Tooltip positioned at the bottom-start of the trigger element.

Bottom - centre

Tooltip positioned at the bottom-centre of the trigger element.

Bottom - end

Tooltip positioned at the bottom-end of the trigger element.

Top - start

Tooltip positioned at the top-start of the trigger element.

Top - centre

Tooltip positioned at the top-centre of the trigger element.

Top - end

Tooltip positioned at the top-end of the trigger element.

Left - start

Tooltip positioned at the left-start of the trigger element.

Left - centre

Tooltip positioned at the left-centre of the trigger element.

Left - end

Tooltip positioned at the left-end of the trigger element.

Right - start

Tooltip positioned at the right-start of the trigger element.

Right - centre

Tooltip positioned at the right-centre of the trigger element.

Right - end

Tooltip positioned at the right-end of the trigger element.

Title

The title can be removed where it is not necessary.

With title

Tooltip with a title.

Without title

Tooltip without a title.

Action

Tooltips can offer a single action through the use of a button.

With action

Tooltip with an action.

Without action

Tooltip without an action.

Close

For tooltips that need to be closed manually.

With close

Tooltip with a close button.

Without close

Tooltip without a close button.

Sizes

Width

Predefined

By default, tooltips have a fixed width of 280px and are not dynamic with the content or container.

Example of a tooltip with the predefined width.

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.

Example of a tooltip with width fluid to content.

Fill container

The width is 100% of the container of the UI trigger. It can only be applied to top and bottom tooltips.

Example of a tooltip with width fluid to container.

Placement

Offset

By default the tooltip has 4px offset between the pointer and the associated UI element. User can override the offset if needed.

Example of a tooltip showing 4px spacing between the end of the pointer and the element.

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.
Tooltip triggered by a chip.
Tooltip triggered by a floating action button.

Auto-dismiss

When close icon or button is not shown, the tooltip will disappear when user hover away from the associated UI element.

Example of a tooltip that dismisses automatically.

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.

Example of a persistent tooltip with a close icon button.
Example of a persistent tooltip with a close icon and an action button.

Only one tooltip at a time

When a new tooltip is triggered, the previous one is dismissed, even if the tooltips are persistent.

This is the suggested pattern for development, this functionality, if required is handled by pillar engineers.
Do
Example of only one tooltip being displayed at a time.
Don't
Example of two tooltips being triggered at the same time.


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.

Example of a tooltip closed by hovering away from the trigger.
Example of a tooltip closed with the close icon.

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.

Do
Example of a tooltip with a simple, contextual action button.
Don't
Example of a tooltip with an action button that contains essential information.


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.

Example of the tooltip component with content overflow.

Examples

LTR examples

Here are some examples of the component in left-to-right context:

Example of the tooltip component in left-to-right context.
Example of the tooltip component in left-to-right context.

RTL examples

Here are some examples of the component in right-to-left context:

Example of the tooltip component in right-to-left context.
Example of the tooltip component in right-to-left context.
Back to top