How to build an accessible Tooltip in React

The floating element uses role="tooltip" and is linked to the trigger via aria-describedby only while visible; it shows on both hover and keyboard focus so it is reachable without a pointer.

When to use a Tooltip

When not to use it

Keyboard interactions

Role tooltip, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <Tooltip content={<button>Undo</button>}><Icon /></Tooltip>

Prefer: <Popover><button>Undo</button></Popover>

Tooltips are hover/focus hints and cannot reliably hold focusable content; interactive content belongs in a Popover

Example

<Tooltip content="Copy to clipboard"><Button>Copy</Button></Tooltip>

See the full Tooltip reference →