Components · Feedback

Tooltip

A tooltip gives an icon-only button a short name when the user hovers it or moves keyboard focus to it. Esc hides it.

Tokens, sizes, spacing, states and requirements. Values come from the live token package and from Figma: Tooltip.

Design Tokens

Resolved from the live token package.

StatePartTokenValue

The background is surface-100 at 90% opacity (in the CSS: rgba(0, 0, 0, 0.9), because the opacity applies to the fill only, not to the text). Font is Breuer Condensed regular with ss02, ss03, ss06. The shadow is elevation-b-40: 0 2px 4px at 10% black plus 0 0 1px at 5% black.


Sizes

SizePaddingType
Small (default)8px 16px14/20, 0.36px, regular (body-sm)
Large (tooltip--lg)12px 16px18/26, 0.36px, regular

Use Small for icon buttons in toolbars and table rows. Add tooltip--lg for Large.


Measurements

Dimensions

Padding and size of each tooltip size. The shaded areas are the padding; the lines show its value.

Padding of the two sizes at true size (1:1). The numbers are read from the component.
AttributeSmall (default)Large (tooltip--lg)
Padding, top and bottom8px12px
Padding, left and right16px16px
Line height20px26px
Height, one line36px50px
Maximum width280px, and never wider than the window minus 8px on each side
CornersSquare

Spacing

The same padding and the beak and distance values as spacing tokens.

Padding

SizeVerticalHorizontal
Small (default)space-8space-16
Large (tooltip--lg)space-12space-16

Beak and distance

PartValue
Beak size6px high, 12.696px wide (rotated for the side types: 6px wide, 12.696px high)
Beak offset (Left, Right, Top Left, Top Right, Bottom Left, Bottom Right)16px from the edge of the tooltip, to the near edge of the beak
Beak offset (Left Top, Right Top)16px from the top of the tooltip
Distance to the elementThe tip of the beak is 4px from the element (space-4), so the tooltip block is 10px away. This is a repo rule: the Figma frame holds no element.

Elevation

The shadow is elevation-b-40: 0 2px 4px at 10% black plus 0 0 1px at 5% black.

TopicRule
Layerz-index: var(--tooltip-z, 300), elevation-b-40 shadow. A page with a sticky header sets --tooltip-z below the header’s z-index on :root, so a tooltip never paints over the menu.

States

Two triggers: hover and keyboard focus (:focus-visible) fade the tooltip in over duration-fast-2 with ease-standard. The tooltip has pointer-events: none so it never gets in the way.

StatePreviewResult

Typography

SizeTypeSize / line heightLetter spacingWeight
Small (default)body-sm14/200.36pxRegular
Large (tooltip--lg)As drawn in Figma18/260.36pxRegular

Breuer Condensed with ss02, ss03 and ss06. Never uppercase, also when the tooltip sits inside an uppercase button. Large uses 18/26 as drawn in Figma: no type token has this pair (body-lg is 18/24 on mobile).


Structure

Elements

ElementPropertyValue
ContainerFillSurface 100 at 90% opacity (opacity on the fill only, not on the text)
ContainerCorners, borderSquare, none
LabelLengthOne to three words
Caret (beak)Size6px high, 12.696px wide. Absent on Body.
Caret (beak)PositionPoints at the center of the trigger, 4px from it. On the start and end types it sits 16px from the edge of the tooltip.
TriggerElementUsually an icon button. The tooltip shows when the user hovers it.

Types

Figma has 11 types in Small and 9 in Large. The Figma name says where the beak sits on the tooltip, not where the tooltip sits next to the element. Figma “Bottom” is a tooltip above the element, with the beak at its bottom. The CSS class names describe the placement, so they are the opposite.

Figma typeBeakTooltip sitsSmallLargeClass
BodyNone—YesYestooltip--body
BottomBottom edge, centered, points downAbove the elementYesYestooltip--top
Bottom LeftBottom edge, 16px from the left, points downAbove the elementYesYestooltip--top-start
Bottom RightBottom edge, 16px from the right, points downAbove the elementYesYestooltip--top-end
TopTop edge, centered, points upBelow the elementYesYestooltip--bottom
Top LeftTop edge, 16px from the left, points upBelow the elementYesYestooltip--bottom-start
Top RightTop edge, 16px from the right, points upBelow the elementYesYestooltip--bottom-end
Left MiddleLeft edge, vertically centered, points leftRight of the elementYesYestooltip--right
Right MiddleRight edge, vertically centered, points rightLeft of the elementYesYestooltip--left
Left TopLeft edge, 16px from the top, points leftRight of the elementYesNotooltip--right-start
Right TopRight edge, 16px from the top, points rightLeft of the elementYesNotooltip--left-start

Small widths in Figma are 59px (top/bottom types) and 65px (side types), set by the sample text “Tooltip”. In use, the width follows the text (white-space: nowrap).

Width

One line when the text fits, otherwise it wraps at max-width: min(280px, 100vw − 16px): never wider than 280px and never wider than the window minus the 8px edge margin. The tooltip is width: max-content, so a short label is as wide as its text.


Motion

PropertyDurationEasing
opacity, hover in and outduration-fast-2ease-standard

Behavior

Automatic placement

Top and Bottom tooltips are automatic by default. components/js/tooltip.js and CSS anchor positioning do the work:

  • The tooltip is centered on the trigger.
  • When a centered tooltip would leave the viewport sideways it aligns to the start or the end instead, as the Start and End examples under Layout & Appearance: the beak sits 16px from the edge of the tooltip and on the center of the trigger, so the tooltip lines up with the outer edge of the trigger. The script adds tooltip--align-start or tooltip--align-end.
  • When the tooltip opens with too little room on its side and more on the other, it flips above or below, beak included (tooltip--flip). CSS alone cannot do this: a browser picks a flip from the layout-time scroll position, which is wrong on a page that scrolls.
  • A page with a sticky header sets --tooltip-safe-top (the height of the header), so room above counts from below the header.
  • Add tooltip--manual to keep a tooltip fixed and centered.
  • The tooltip is position: fixed, so a clipping container cannot cut it off. Where anchor positioning is not supported, the tooltip stays centered, as in manual mode.
  • The other types (start, end, left, right) are always manual.

Accessibility Requirements

TopicRequirement
TriggerHover over the wrapper (.tooltip-wrap:hover) or keyboard focus on the trigger (:focus-visible, not the focus a mouse click gives). Esc hides it without moving focus (WCAG 1.4.13 dismissible).
Namearia-label on the button with the same text as the tooltip. The tooltip itself is not announced.
TextOne to three words. No information the user needs to complete a task: it disappears when the pointer moves away.
Interactive contentNone. A tooltip cannot take focus, so it never holds a button, link or image. Use a Toggletip (TBA).

Open point: hoverable (WCAG 1.4.13). The tooltip has pointer-events: none, so the pointer cannot move onto it to read it. Persistent and dismissible are met (it stays until the pointer or focus leaves, Esc hides it). Hoverable would need a pointer-reachable tooltip, which conflicts with “never in the way”. To be decided.