You are currently on Anvil1, which is now in maintenance mode. Visit Anvil2 to get the latest version of the design system.
components / Content

Tooltip

Content

Tooltip content is designed to be concise. Tooltips only support basic text and cannot support features like bold, italics, links, paragraphs, or images. Basic symbols and emojis (e.g. ⌘, ©, 👋) are allowed.

A tooltip's max width is 268px (252px/18em for text, with 8px of padding on both sides).

Directions

Tooltips can appear in many directions relative to an element. Direction is manually controlled. The default is to appear above the element.

With Other Components

With icons

Tooltips should be used when icons are present without visible descriptions.

With an Avatar

With a Progress Bar

With a Tag

With a Text

Open through a React Portal

Tooltips can be opened outside of the DOM hierarchy through a React portal. These ‘portaled’ tooltips:

  • Won't be clipped by the boundaries of a container, which has overflow: hidden property set
  • Are hoverable, they don't disappear when pointer moves over them, so the text content may be marked and copied

Best Practices

  • Tooltips should be clear and concise.
  • Tooltips should appear with icon-only buttons.
  • Tooltips can be used to provide keyboard shortcuts.
  • Tooltips should supplement. Essential information should not be behind a component that only appears on hover.
  • Only one tooltip should be active at any point.
  • Avoid error or warning messages. Use one of the notification components instead.
  • Avoid messages longer than two lines in length.
  • Complex information, interactions, or needing a click state should use the Popover component.

  • For more complex content, use a Popover component.

Importing

import { Tooltip } from '@servicetitan/design-system';