Rost
← All components
component

Tooltip

A small label that explains something when you point at it or focus it.

In codeContract: reviewGuidance: agreedContract on GitHubFigma 138:276
label
tooltip

When to use

  • Used to explain something that can't explain itself: an icon-only button, or a nav item for the page you're already on.

When not to use

  • Anything people need in order to use the page. A tooltip is easy to miss, and on a phone there's no hover.
  • More than a few words. That's help text, or an InlineBanner.

Behaviour

Shows on hover and on keyboard focus of the thing it explains, 8px under it, and goes when the pointer or focus leaves.

Accessibility

  • Element: role="tooltip", linked from the thing it explains with aria-describedby.
  • Name: the tooltip isn't a name. The thing it explains still needs its own aria-label.
  • Keyboard: it shows when focus arrives, and Escape hides it without moving focus.
  • Focus: it never takes focus itself.
  • Hover: it never holds anything you'd need to click, and the pointer can move onto it without it going.

Content

A few words, sentence case, no full stop.

Props

PropTypeValuesDefault
labelslot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

PartPropertyValueToken
rootdisplayinline-flexlayout
rootalign-itemscenterlayout
rootjustify-contentcenterlayout
rootwhite-spacenowraplayout
rootheight20pxon purpose: Figma's own 20px; no size token is 20.
rootpadding-left8pxspacing/gap/small
rootpadding-right8pxspacing/gap/small
rootpadding-top0pxspacing/gap/none
rootpadding-bottom0pxspacing/gap/none
rootborder-radius4pxspacing/radius/xsmall
rootbackground#3a3a3aactions/secondary/regular/default/background
labelfont-family'General Sans Variable'font-family/base
labelfont-weight500typography/label/font-weight/medium
labelfont-size12pxtypography/label/font-size
labelline-height14pxtypography/label/line-height
labelletter-spacing0pxtypography/label/letter-spacing
labelcolor#d3d9d5actions/secondary/regular/default/label