StartFoundationsComponentsContent

Tooltip

A tooltip is a short text bubble that shows when people hover over or focus a control. It never holds anything people need.

Stable Figma
OverviewUsageAPIAccessibility
Delete
<tk-tooltip text="Also removes the file from shared folders">
  <tk-button tone="danger">Delete</tk-button>
</tk-tooltip>

Anatomy

Part What it is
tk-tooltip the wrapper
default slot one control that can take focus: the trigger
bubble the text, shown in the top layer, 4px from the trigger; no arrow

Types

Share
<tk-tooltip type="label">
  <tk-icon-button label="Copy link"><tk-icon name="copy"></tk-icon></tk-icon-button>
</tk-tooltip>
<tk-tooltip text="Shared with 3 people">
  <tk-button>Share</tk-button>
</tk-tooltip>

Both look the same; they differ in what screen readers hear.

  • label: the text is the control's name. Use it only on icon-only controls. With a tk-icon-button, leave text out: the tooltip shows the button's label, so the two always match.
  • description (default): the text adds to the control's name. Don't repeat the visible label.

Placement

Pin Archive
<tk-tooltip text="Moves the item to the top" placement="top">
  <tk-button>Pin</tk-button>
</tk-tooltip>
<tk-tooltip text="Moves the item to the end" placement="end">
  <tk-button>Archive</tk-button>
</tk-tooltip>
  • placement is the preferred side: top, bottom (default), start, or end. start and end follow the text direction.
  • When there's no room, the bubble moves to the opposite side and stays inside the viewport. Change the side only to keep something important uncovered.

Showing and hiding

  • Hover shows the bubble after 400ms; keyboard focus shows it at once.
  • It stays while the pointer is on the trigger or the bubble, and never times out.
  • Esc hides it and focus stays on the trigger.
  • It shows and hides instantly, with no animation.
  • A tap opens nothing: it activates the control. Keep essential information out of the tooltip, so a touch user loses nothing.