Tooltip

Accessible React tooltip built on Radix that shows on hover and focus, with a HelpIcon trigger, a title and icon variant, and an inverted surface. RTL ready.

Wrap the trigger with TooltipTrigger asChild and put the message in TooltipContent. HelpIcon bundles a ready-made "?" trigger.

When to use

Use Tooltip for a short hint that clarifies an icon button or a field label, such as what a reference number means. Use HelpIcon next to form labels for a ready-made "?" trigger.

Do not put essential instructions in a tooltip; they are hidden by default and unavailable on touch. Use helperText on the field instead.

Examples

Basic

Title, icon & inverted surface

Help icon

Arabic (RTL)

Props

Props declared by Tooltip. Native attributes of the underlying element pass through.

<Tooltip>

PropTypeDefaultDescription
childrenReactNode
openboolean
defaultOpenboolean
onOpenChange(open: boolean) => void
delayDurationnumber700The duration from when the pointer enters the trigger until the tooltip gets opened. This will override the prop with the same name passed to Provider.
disableHoverableContentbooleanfalseWhen true, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.

<TooltipTrigger>

PropTypeDefaultDescription
asChildboolean

<TooltipContent>

PropTypeDefaultDescription
invertedbooleanDark surface (gray-800) instead of the default light card. Mirrors SDGA Inverted.
titlereact.ReactNodeBold heading shown above the body text.
iconreact.ReactNodeLeading help badge: true renders the SDGA "?" help-circle, or pass your own node.
arrowbooleanShow the beak pointing at the trigger. Defaults to true.
side"top" | "right" | "bottom" | "left"
sideOffsetnumber
align"center" | "start" | "end"
alignOffsetnumber
arrowPaddingnumber
avoidCollisionsboolean
collisionBoundaryElement | Element[]
collisionPaddingnumber | Partial<Record<"top" | "right" | "bottom" | "left", number>>
sticky"always" | "partial"
hideWhenDetachedboolean
updatePositionStrategy"always" | "optimized"
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
aria-labelstringA more descriptive label for accessibility purpose
onEscapeKeyDown(event: KeyboardEvent) => voidEvent handler called when the escape key is down. Can be prevented.
onPointerDownOutside(event: PointerDownOutsideEvent) => voidEvent handler called when the a pointerdown event happens outside of the Tooltip. Can be prevented.

Accessibility

The tooltip opens on hover and on keyboard focus, and Escape closes it. Radix associates the content with the trigger, so screen readers read the hint when the trigger is focused.

The trigger must itself be focusable, so wrap a button or link with TooltipTrigger asChild. Keep the text short; tooltips are not for paragraphs.