When the user's mouse or focus rests on an element, a non-interactive popup is displayed near it.
A couple notes on using tooltips:
Touch Events: Touch events are currently not supported. There's not a lot of research or examples of these types of tooltips on mobile. We have some ideas but need to validate them first before implementing. Please adjust your interfaces on mobile to account for this.
import { Tooltip, useTooltip, TooltipPopup } from "@reach/tooltip";
import { VisuallyHidden } from "@reach/visually-hidden";
import "@reach/tooltip/styles.css";
function Example() {
return (
<Tooltip label="Save">
<button>
<VisuallyHidden>Save</VisuallyHidden>
<span aria-hidden>💾</span>
</button>
</Tooltip>
);
}