Names a control on hover and on keyboard focus, built on [`@radix-ui/react-tooltip`](https://www.radix-ui.com/primitives/docs/components/tooltip).

pnpm add @behivetech/atoms.tooltip

You are viewing Tooltip v0.2.5, snapshotted 2026-11-10. The latest is v0.2.6. Go to the latest →

Names a control on hover and on keyboard focus, built on @radix-ui/react-tooltip.

Intended for icon-only controls, where the tooltip is the only thing naming the control. It replaces the title attribute, which delays about a second, is OS-styled with no theming, has no touch support, and gives no control over placement.

Usage

1import { Tooltip } from "@behivetech/atoms.tooltip";
2import { BoxIcon } from "@behivetech/atoms.icon";
3
4<Tooltip label="Rectangle" side="right">
5 <button type="button">
6 <BoxIcon />
7 </button>
8</Tooltip>;

The child is rendered as-is via Radix's asChild, so the trigger stays your own element. Tooltip mounts its own provider — you do not need to add one.

Disabled triggers

A disabled element fires no pointer events, so a bare Radix tooltip never opens on one. That is the moment a tooltip matters most: when a control is unavailable and the user wants to know why.

Tooltip handles it. When the child is disabled it is wrapped in a focusable span that carries the listeners, and the child is made pointer-transparent so hover lands on the wrapper. The control stays disabled, keeps its own accessible name, and the explanation is reachable by keyboard and screen reader.

1<Tooltip label="You do not have permission to edit roads">
2 <button type="button" disabled>
3 <RoadIcon />
4 </button>
5</Tooltip>

No wrapper is added when the trigger is enabled.

Properties

Tooltip props

PropTypeDefaultDescription
children*ReactElement<unknown, string | JSXElementConstructor<any>>—The element the tooltip describes — rendered as-is via Radix's `asChild`
label*string—Text shown in the tooltip. This is the control's name when the trigger is icon-only.
classNamestring—Additional class names to merge with the tooltip content element
side"top" | "right" | "bottom" | "left"topWhich side of the trigger to place the tooltip on; defaults to "top"