Skip to main content

Tooltips

Usage

Definition

Tooltips display text that describes an element or provides additional information. Tooltips can appear on hover, focus, or tap, and disappear after a short duration.

Common Characteristics

All tooltips are light text on a dark background and are normally positioned below the element they are paired with. They fade in and persist on hover or tap, and fade out off hover or another tap. Tooltips are stationary and do not follow the cursor.

Tooltip Basics

Tooltips come in two sizes: small and large. Small tooltips are always a single line of small, center-aligned text. Large tooltips have larger, left-aligned text that can wrap, and a pointer.

Interactivity

When a tooltip is paired with a functional element (e.g. a print icon, a linked avatar, etc), the tooltip is displayed on hover, but is ignored on tap. The tap executes the function instead of displaying the tooltip.

With non-functional elements (e.g. an info icon, etc), the tooltip is displayed on tap or on hover.

Small Tooltip

The small tooltip width varies with the center-aligned, 12px text plus 8px left/right padding up to a maximum of 200px. If a small tooltip won’t accomodate your text on a single line, use a large tooltip instead.

Functional Element

Functional elements will not show tooltips on touch devices.

Non-Functional Element

Large Tooltip

The large tooltip has a fixed 200px width, 16px left/right padding, and wrapping, left-aligned 14px text.

Functional Element

Functional elements will not show tooltips on touch devices.

Non-Functional Element

Typical Examples

Tooltips are commonly used with icon functions like print or close, or to provide contextual information.

Icon functions with small tooltips.
Functional elements will not show tooltips on touch devices.

Info icon with large tooltip

Avatar with small tooltip

Design

Code

Small Tooltip for Non-Functional Elements

Live Editor
Result
Loading...

Large Tooltip for Non-Functional Elements

Live Editor
Result
Loading...

Small Tooltip for Functional Elements

Functional elements will not show tooltips on touch devices.

Live Editor
Result
Loading...

Large Tooltip for Functional Elements

Functional elements will not show tooltips on touch devices.

Live Editor
Result
Loading...

Tooltip supports placement

To adjust the alignment of the arrow, Tooltip adds variation to the placement prop by adding -start and -end.

Live Editor
Result
Loading...

Tooltip with arrow styling

Live Editor
Result
Loading...

Delay before showing or hiding the tooltip

Live Editor
Result
Loading...

Disabled Tooltip

Live Editor
Result
Loading...

Tooltip without arrow

Live Editor
Result
Loading...

Tooltip Props

NameTypeDefaultDescription
classNamestring""Adds additional classes to the tooltip
delaynumber or object0Adds a delay to showing and hiding the tooltip on hover
disabledbooleanfalseDisables the tooltip from opening
hideArrowbooleanfalseHides the arrow on the tooltip
isOpenbooleanfalseSets whether the tooltip is shown or not
modifiersarray(object)[]Prop for any additional custom modifiers as specified by the react-popper library
placementstring"bottom"Sets the placement of the tooltip relative to its target. Supporting placements include auto,top,bottom,right,left. Append -start or -end to align the tooltip arrow.
sizestring"lg"Sets size of the tooltip to either sm or lg
targetstring, ref, or noderequired (no default)Associates the id of the element which triggers the tooltip
targetIsFunctionalbooleanfalseSets whether the element that triggers the tooltip also has an action associated to it
togglefunction() => {}Callback function when the tooltip is toggled