Tooltip
Hover/focus popover. Portals to document.body, auto-flips when it would
overflow the viewport. Source: Figma {FK-Tooltip} (11:2720).
Live preview
Hover any button — press Tab to see keyboard focus also triggers the tooltip.
Behavior
- Positioning is
position: fixed— the tooltip is anchored to the trigger viagetBoundingClientRect()measurements. - Auto-flips when the preferred side would overflow the viewport, then clamps to a 4px viewport margin.
- Portals into
document.bodyso the tooltip escapes overflow: hidden parents. - Rendered as
role="tooltip".
Do / don’t
- ✅ Use for icon-only buttons to explain their purpose (with
aria-labelon the button too). - ✅ Use to expand acronyms or explain metrics.
- ❌ Don’t put critical information in a tooltip — mobile has no hover.
- ❌ Don’t nest interactive elements inside a tooltip. Use a Popover for that.