Skip to main contentCarbon Design System

Tooltip

The following page documents visual specifications such as color, typography, structure, and size.

Color

A tooltip has two states: open and closed. The open state occurs when a user hovers or focuses on the UI elements, while the closed state means the tooltip is hidden. By default, the tooltip is hidden and inactive.

ElementPropertyColor token
Trigger (other UI elements)––
Trigger (definition label)border
$border-strong
Closed state of an icon button and definition tooltip

Example of an icon button and definition tooltip in the closed state.

Interactive state color

The color table applies to the tooltip when the UI elements or definition label are triggered and in the open state.


StateElementPropertyColor token
Opencontainer (all components with tooltip)background-color
$background-inverse
Opentext (all components with tooltip)text-color
$text-inverse
Open (hover)trigger (definition tooltip)border
$border-interactive
Open (focus)label and border (definition tooltip)border
$focus
Open state of tooltip examples

Example of an icon button and a definition tooltip in the open state with mouse and keyboard interactions

Typography

Tooltip labels and text should be set in sentence case.

ElementFont size (px/rem)Font weightType token
Label12 / 0.75Regular / 400
$label-01
Body text14 / 0.875Regular / 400
$body-01

Structure

All tooltip types vary in height based on their content.

The tooltip is designed for both multi-line text, with 16px padding on all sides for better spacing, and single-line text, which is more compact since it typically contains only a few words and doesn’t wrap.

ElementPropertypx / remSpacing token
Container (multi-line)max-width288 / 18—
padding16 / 1
$spacing-05
margin-top4 / 0.25
$spacing-02
Container (single-line)max-width208 / 13—
padding-left, padding-right16 / 1
$spacing-05
padding-top, padding-bottom2 / 0.125
$spacing-01
margin-top4 / 0.25
$spacing-02
Caretpopover-caret6 / 0.375—
Structure and spacing measurements for tooltips

Structure and spacing measurements for multi-line and single-line text | px / rem

Definition tooltip structure

ElementPropertypx / remSpacing token
Containermax-width176 / 11—
padding-left, padding-right16 / 1
$spacing-05
padding-top, padding-bottom8 / 0.5
$spacing-03
margin-top4 / 0.25
$spacing-02
Caretpopover-caret6 / 0.375–
Triggerborder-bottom1 px–
Structure and spacing measurements for a definition tooltip

Structure and spacing measurements for a definition tooltip | px / rem

Default placement

Tooltip directions, by default, are set to auto. Upon opening, tooltips can detect the edges of the browser to be placed in view so the container does not get cutoff. Tooltips can instead use specific directions and may be positioned top, right, bottom, or left of the trigger item. Tooltips should be placed at least 16px / 1rem off of the bottom of the page and not bleed off page or behind other content. On mobile, tooltips can only appear below the tooltip icon.

Placement examples for a tooltip

Placement examples for a tooltip

Feedback

Help us improve this component by providing feedback, asking questions, and leaving any other comments on GitHub.