Tooltip

A short description of one child, shown on hover, keyboard focus and a long touch - a role="tooltip" in a Portal, placed beside its child and flipped for want of room.

Accessibility

  • role="tooltip", with the child named or described by it.
  • Opens on keyboard focus and closes on Escape; stays open while hovered (WCAG 1.4.13: dismissible, hoverable, persistent) - unless isInteractive={false}, for a hint with nothing in it to use.
  • Never takes the focus, and holds nothing that needs it: a tooltip is for text, not controls.
  • Placed by useAnchoredPlacement, shared with Menu: it follows its child as the page scrolls.