Tooltip is a non-interactive overlay that briefly explains the function of the trigger element.
If you're looking for a simple tooltip, consider using the HTML
title
attribute instead.
Tooltip is a non-interactive overlay that briefly explains the function of the trigger element.
If you're looking for a simple tooltip, consider using the HTML
title
attribute instead.
Escape
key or by navigating outside.To avoid parent containers possibly clipping the tooltip and its content, render the tooltip outside the DOM hierarchy of its parent component.
In React, a common mechanism for this is a Portal.
By default, disabled elements like <button>
do not trigger mouse events.
This is an unfortunate misinterpretation of the spec by the browsers. As a workaround, we recommend using Pointer Events (which follow the spec more closely) for disabled trigger elements.
As an alternative, wrapping the disabled element in a <span>
can also work since all of the mouse events would then be placed on it instead.
We recommend using Reach UI's tooltip as a base for your React based implementation.
The accessibility requirements for this component are defined by the WAI-ARIA Practices for Tooltip: