Tooltips

Tooltips are text bubbles that display when a user hovers over an abbreviation or info icon. Tooltips help reduce clutter within the interface and hides helpful hints and information for the user until it is needed. Style Guide provides a pure CSS solution and a JS alternate for HTML tooltip content, such as headlines or links.

Standard

Tooltip Up

Tooltip Right

Tooltip Down

Tooltip Left

Container(s) [data-tooltip]
Modifiers [data-tooltip-pos="up"] [data-tooltip-pos="right"] [data-tooltip-pos="down"] [data-tooltip-pos="left"]
States [data-tooltip-length="small"] [data-tooltip-length="medium"] [data-tooltip-length="large"] [data-tooltip-length="xlarge"]
<span data-tooltip="Tooltip up!" data-tooltip-pos="up"><i class="sg-icon sg-icon-info-circle"></i></span>
<span data-tooltip="Tooltip right!" data-tooltip-pos="right"><i class="sg-icon sg-icon-info-circle"></i></span>
<span data-tooltip="Tooltip down!" data-tooltip-pos="down"><i class="sg-icon sg-icon-info-circle"></i></span>
<span data-tooltip="Tooltip left!" data-tooltip-pos="left"><i class="sg-icon sg-icon-info-circle"></i></span>
view raw tooltips.html hosted with ❤ by GitHub

Guidelines

  • Text should be complete sentences and ≤ 140 characters.
  • Before using a tooltip, ask first whether the design or nomenclature can be changed.
  • Only use tooltips for non-critical information.
  • Pick a tooltip orientation using the following order: up, right, left, down.
  • Use "Learn more" links when further explanation is warranted. See JS Tooltips below.
  • Use the underlined style when you need a more subtle treatment.
Don't use tooltips to communicate must-see content.
Don't put too much content in a tooltip.

Underline

Tooltip Up
Tooltip Right
Tooltip Down
Tooltip Left
Container(s) [data-tooltip]
Required .has-underline
Modifiers [data-tooltip-pos="up"] [data-tooltip-pos="right"] [data-tooltip-pos="down"] [data-tooltip-pos="left"]
States [data-tooltip-length="fit"] [data-tooltip-length="small"] [data-tooltip-length="medium"] [data-tooltip-length="large"] [data-tooltip-length="xlarge"]
<span class="has-underline" data-tooltip="Tooltip up!" data-tooltip-pos="up">Tooltip Up</span>
<span class="has-underline" data-tooltip="Tooltip right!" data-tooltip-pos="right">Tooltip Right</span>
<span class="has-underline" data-tooltip="Tooltip down!" data-tooltip-pos="down">Tooltip Down</span>
<span class="has-underline" data-tooltip="Tooltip left!" data-tooltip-pos="left">Tooltip Left</span>

HTML Content

The CCV number is a 3 or 4 digit security code printed on the front or back of your card.

The CCV number is a 3 or 4 digit security code printed on the front or back of your card.

Container(s) .tooltip-js-content
Required .tooltip-js-parent
States .is-hovered .is-visible .is-left [data-tooltip-length="small"] [data-tooltip-length="medium"] [data-tooltip-length="large"] [data-tooltip-length="xlarge"]
<div class="input-text-wrap">
<label class="input-text-label" for="input-text-example-ccv">CCV</label>
<input type="text" id="input-text-example-ccv">
<div class="input-info-tooltip">
<i class="sg-icon sg-icon-info-circle input-info-icon tooltip-js-parent"></i>
<div class="tooltip-js-content">
<p>The <a href="#">CCV number</a> is a 3 or 4 digit security code printed on the front or back of your card.</p>
</div>
</div>
</div>