Tooltip

A tooltip is a message box that is displayed when a user hovers over, or gives focus to, an interactive UI element. The tooltip provides additional information about the action item it is paired with.

Interactive Playground

The Interactive Playground allows you to experiment with various tooltip styles and features. Once you get the results you want, copy the HTML or React code provided and paste it into your application.

<div class="neo-tooltip neo-tooltip--up neo-tooltip--onhover">
<button
aria-describedby="tooltip-div-id"
class="neo-btn neo-btn--default neo-btn-primary neo-btn-primary--default"
>
Hover me to see a tooltip
</button>
<div
id="tooltip-div-id"
role="tooltip"
class="neo-tooltip__content"
>
<div class="neo-arrow">
</div>
Tooltip text provides additional information about the attached UI element.
</div>
</div>
<Tooltip
label="Tooltip text provides additional information about the attached UI element."
position="top"
multiline={false}
>
<Button>Hover me to see a tooltip</Button>
</Tooltip>

Anatomy

An action item in the UI may include a tooltip that appears when the item has focus. The tooltip text explains in more detail what the action item will do when selected, or what type of information is required.

Image showing the different parts that make up a tooltip, further explained in the text below
  • Container:

    The tooltip text is white and appears within a black container near the action item.
  • Text Block:

    This is the text for the tooltip. It can be one or more lines, but it should be brief.
  • Tooltip Anchor:

    The anchor arrow points toward the action item associated with the tooltip.

Positioning

Position the tooltip so that it does not obscure the action item it is associated with. Try to keep the tooltip away from other UI elements, particularly other action items.

Placement

The tooltip can appear to the right, left, top or bottom of the action item. The anchor can also be offset toward the corner of the container. Select the correct placement so that the tooltip does not cover the action item or any other interactive field. The tooltip text is left justified within the container.

Image showing the different directions that a tooltip can be positioned in relation to the anchor
  • Left:

    The tooltip appears to the left of the action item at about the same level. The container is vertically centered around the anchor.
  • Top:

    The tooltip appears above the action item and is centered horizontally around the anchor.
  • Bottom:

    The tooltip appears beneath the action item and is centered horizontally around the anchor.
  • Right:

    The tooltip appears to the right of the action item at about the same level. The container is vertically centered around the anchor.
Image showing the different offsets that a tooltip can be positioned in relation to the anchor

For tooltips set to top or bottom, the anchor can be moved to the left or right corner of the container. Use this feature to prevent the tooltip from blocking another field, or where space limitations exist.

Behavior

A tooltip is a message box that is displayed when a user hovers over or gives focus to, an interactive UI element. The tooltip provides additional information about what it does or what information is required.

image showing an array of icon buttons with tooltips positioned above the icon buttons

DO: Use basic tooltips by default. Off center tooltips can be used when there is limited space.

image showing an array of icon buttons with a tooltip positioned above one of the icon buttons, and a tooltip positioned below another of the icon buttons

DON'T: Do not mix and match the placement of the tooltip within the same component.

Image showing a password field with a label and helper text, no tooltip is used

DO: Put all critical instructions and labels directly onto the UI.

Image showing a password field with a label and a tooltip instead of helper text

DON'T: Do not put important instructions into a tooltip.

Image of a text input with multiple icon buttons, a tooltip is used to display helper text when the user hovers over a icon button

DO: Use tooltips only when the associated text cannot be displayed on the screen.

Image of a text input with a label and an info icon in the label, a tooltip is shown over the info icon

DON'T: Do not substitute tooltips for helper text.

Image showing two chip icons and a 'plus six' text, a tooltip is displayed when hovering over the 'plus six' text with a comma separated list of the six items

DO: Use tooltips to display the full content when it is too large to be shown in the allocated space.

Image showing a tooltip within a navigation item that has cut off text with the full text displayed in the tooltip

DON'T: Do not use tooltips within navigation items. Instead, either expand the item to show all of the text, or wrap it onto multiple lines.

Image of a microphone icon with a green checkmark, a tooltip is displayed that contains the text 'Microphone connected'

DO: Use concise wording to describe the action or the state.

Image of a microphone icon with a green check, a tooltip is displayed that contains the text 'Microphone icon with a green checkmark'

DON'T: Do not describe the visual appearance of the element.

Image of multiple communication related icons, a tooltip is displayed above a microphone icon with a green checkmark, the tooltip reads 'Microphone connected'

DO: Open tooltips in appropriate positions.

Image of multiple communication related icons, a tooltip is displayed to the right of a microphone icon with a green checkmark, the tooltip is displayed overtop of multiple other icons, the tooltip reads 'Microphone connected'

DON'T: Do not add Tooltips where they cover other related content

Image of an icon with a tooltip that displays a full sentence over multiple lines.

DO: Multiline text is applied when the container width exceeds 300 pixels.

Image of an icon with a tooltip that displays one very long line of text.

DON'T: Do not create unusually large tooltips with one line of text. Use multiline tooltips instead.

Specs

Single line tooltips are 32 pixels in height not including the anchor. Tooltips will detect the edges of the browser to be properly placed in the window so the container does not get cutoff and the anchor is correctly positioned.

Image showing the height for the tooltip
Image showing the padding and margin of the tooltip

If the text makes the tooltip wider than 300 pixels, it will automatically wrap to a new line. All text is left aligned regardless of the tooltip position or anchor direction.

Keyboard Interactions

Accessibility requires that each item on the screen is reachable using the keyboard alone. The mouse is not always an option for some users. Tooltips will be displayed as each interactive element receives focus.

Keyboard navigation employs the following shortcuts.

Keystrokes Interaction
Tab Moves to the element and displays the tooltip if present.
Esc Dismisses the open tooltip.

Components