Tooltip

OverviewStyleGuidelinesCodeAccessibilityDemos

Usage

Use a tooltip as a way for users to see more information before they select an element, go to a new page, or trigger an action on the page.

Tooltip vs. popover

Both tooltips and popovers provide contextual information for users. However, they differ in a few ways.

Tooltip

  • Used for brief messages (one or two lines of text)
  • Contains only plain text.
  • Appears when triggering element receives mouse hover, keyboard focus, or is tapped.
  • Has no internal means of dismissal (e.g., a close button).
  • Dismissed when triggering element loses hover/focus, or when a touchscreen user taps elsewhere.

Popover

  • Can be more descriptive than a tooltip.
  • Can contain headings, images, and interactive content.
  • Appears when triggering button is clicked.
  • Has a close button.
  • Dismissed when user clicks close button, presses esc, or clicks/taps outside the popover.

Content

Content in a tooltip is limited to text only. Consider the following when writing tooltip content.

Various text examples; from left to right, the text length starts very short, but gets longer and longer

Character count

A tooltip's body text should be short and descriptive.

Element Character count
Body 60

Orientation

The correct orientation of a tooltip depends on the amount of content and browser window. If a tooltip covers up important information or gets cut off, choose a different orientation.

Various orientation examples; from left to right and top to bottom, top, right, bottom, and left

Behavior

When a cursor or focus is moved, the tooltip disappears. On mobile devices, users must tap to trigger a tooltip and then tap again to make it disappear.

Various behavior examples; from top to bottom, how a tooltip behaves when the trigger is hovered, focused, and tapped

Responsive design

A tooltip can generally be used on both large and small breakpoints if the content is not too long.

Examples of a tooltip used on large and small breakpoints

Best practices

White on white

Light theme tooltip against a light background

Use the tooltip that corresponds with the theme of the container it’s in.

Dark theme tooltip against a light background

Do not use a dark theme tooltip in light theme environments and vice versa.

Cut off by browser window

Tooltip fits in the bounds of a form container

Place the tooltip so that the whole element is visible.

Tooltip is cut off by the edge of a form container

A tooltip should not be cut off by the browser window. Change the orientation if it does.

Unnecessary pairing

Tooltip that says 'Settings' above an icon

Tooltips should be used if a user might need to know more information to understand the page or to complete an action.

Tooltip that says 'Click here to get started' above a call to action that says 'Get started'

Do not add a tooltip to interface elements or actions that do not require further explanation.