@reach/tooltip

Accessible tooltips

@reach/tooltip downloads @reach/tooltip version @reach/tooltip license

@reach/tooltipSimilar Packages:
Npm Package Weekly Downloads Trend
3 Years
🌟 Show real-time usage chart on @reach/tooltip's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of @reach/tooltip](https://npm-compare.com/img/npm-trend/THREE_YEARS/@reach/tooltip.png)](https://npm-compare.com/@reach/tooltip#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 Show GitHub stars trend chart on @reach/tooltip's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of @reach/tooltip](https://npm-compare.com/img/github-trend/@reach/tooltip.png)](https://npm-compare.com/@reach/tooltip)
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
@reach/tooltip149,2426,00581.4 kB99-MIT
README for @reach/tooltip

@reach/tooltip

Stable release MIT license

Docs | Source | WAI-ARIA

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:

  • Do not use tooltips for information vital to task completion. The elements they are attached to should usually make sense on their own, but a tooltip can help provide a little bit more information--especially for new users of your app.
  • Keep the content minimal, they are not intended to hide critical content.
  • If you want interactive content, you can use a Dialog.

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>
	);
}