Tooltip
Color
Standard tooltip
Element | Property | Color token |
---|---|---|
Label | text color | $text-secondary |
Trigger button | svg | $icon-secondary |
Container | background-color | $background-inverse |
Text | color | $text-inverse |
Interactive states
State | Element | Property | Color token |
---|---|---|---|
Hover | trigger | svg | $icon-primary |
Active | trigger | svg | $icon-primary |
Focus | trigger | border | $focus |
![Closed and open states for a standard tooltip Closed and open states for a standard tooltip](/static/eb1993199ac51c603b4b83e45fccb51a/3cbba/tooltip-style-1.png)
Example of closed (top), hover (middle), and focus (bottom) states for a standard tooltip
Icon button tooltip
Element | Property | Color token |
---|---|---|
Container | background-color | $background-inverse |
Text | color | $text-inverse |
Interactive states
Icon button tooltip states rely on what kind of button is being used. Refer to button styles for specific hover and focus states.
![Closed and open states for an icon button tooltip Closed and open states for an icon button tooltip](/static/5609cc7ebd7673529a65b6ecd5516a3b/3cbba/tooltip-style-2.png)
Example of closed (top), hover (middle), and focus (bottom) states for an icon button tooltip
Definition tooltip
Element | Property | Color token |
---|---|---|
Label | text color | $text-secondary |
Trigger | border | $border-strong |
Container | background-color | $background-inverse |
Text | color | $text-inverse |
Interactive states
State | Element | Property | Color token |
---|---|---|---|
Hover | trigger | border | $border-interactive |
Active | trigger | border | $border-interactive |
Focus | label and border | border | $focus |
![States for definition tooltip States for definition tooltip](/static/b5df62ce17e663c285f6d00cd31ce3c6/3cbba/tooltip-style-3.png)
Example of closed (top-left), hover (top-right), active (bottom-left) and focus (bottom-right) states for definition button tooltip
Typography
Tooltip labels and text should be set in sentence case.
Element | Font-size (px/rem) | Font-weight | Type token |
---|---|---|---|
Label | 12 / 0.75 | Regular / 400 | $label-01 |
Body text | 14 / 0.875 | Regular / 400 | $body-01 |
Structure
All tooltip types have a varying height based on the amount of content they contain.
Standard tooltip
Element | Property | px / rem | Spacing token |
---|---|---|---|
Container | max-width | 288 / 18 | – |
padding | 16 / 1 | $spacing-05 | |
margin-top | 8 / 0.5 | $spacing-03 | |
Trigger icon | height, width | 16 / 1 | – |
margin-left | 8 / 0.5 | $spacing-03 |
![Structure and spacing measurements for a standard tooltip Structure and spacing measurements for a standard tooltip](/static/a937954d151558bae1c26b3ddb577498/3cbba/tooltip-style-4.png)
Structure and spacing measurements for a standard tooltip | px / rem
Icon button tooltip
Class | Property | px / rem | Spacing token |
---|---|---|---|
Container | max-width | 208 / 13 | – |
padding-left, padding-right | 16 / 1 | $spacing-05 | |
padding-top, padding-bottom | 2 / 0.125 | $spacing-01 | |
Caret | margin-top | 4 / 0.25 | $spacing-02 |
![Structure and spacing measurements for an icon button tooltip Structure and spacing measurements for an icon button tooltip](/static/055d8c160420eeb129c609070b270b25/3cbba/tooltip-style-5.png)
Structure and spacing measurements for an icon button tooltip | px / rem
Definition tooltip
Element | Property | px / rem | Spacing token |
---|---|---|---|
Container | max-width | 176 / 11 | — |
padding-top, padding-bottom | 8 / .5 | $spacing-04 | |
padding-left, padding-right | 8 / .5 | $spacing-04 | |
margin-top | 4 / 0.25 | $spacing-02 | |
Trigger | border-bottom | 1 px | — |
![Structure and spacing measurements for definition tooltip Structure and spacing measurements for definition tooltip](/static/373deb6df712460d24a7065b02a6e868/3cbba/tooltip-style-6.png)
Structure and spacing measurements for definition tooltip | px / rem
Placement
Tooltip directions by default are set to auto. Upon opening, tooltips can detect the edges of the browser to properly 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 to 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](/static/4fd942a85638a366e11e60155d1602bf/3cbba/tooltip-style-7.png)
Placement examples for a tooltip