Components

Tooltip

A React tooltip with a Liquid Glass popup, configurable delay, placement, and an optional arrow.

Tooltip renders the trigger, portal, positioner, glass popup, directional arrow, and content internally. It is a visual hint for sighted pointer and keyboard users, not a replacement for visible labels or accessible descriptions.

Keep the trigger's accessible name aligned with the tooltip content. Icon-only triggers need an aria-label; the tooltip itself is supplementary.

Basic example

Pass one element as trigger. It must forward props and refs to its root element, as Button does.

Placement

side, align, sideOffset, and alignOffset control the preferred position. The tooltip flips or shifts when it would overflow the viewport.

Controlled usage and arrow

Use open and onOpenChange to control visibility, and set arrow={false} for a flat tooltip.

The tooltip is closed.

Delay

delay controls how long the pointer must rest before the tooltip opens; closeDelay controls the closing delay. Both are passed to the Base UI trigger. Set delay={0} for immediate feedback during onboarding, or a longer delay when tooltips appear frequently.

Icon-only trigger

Tooltips are often paired with icon buttons. Give the trigger its own aria-label; the tooltip text is not a substitute for the button's accessible name.

Accessibility

Tooltip opens when the trigger is hovered or receives keyboard focus and closes on blur, Escape, or an outside press. The popup is visual-only: it is not exposed as a description, and tooltips are not available to touch or screen reader users. The trigger must carry its full accessible name from visible text, aria-label, or aria-labelledby.

Tooltip content must be short and supplementary. Do not put interactive controls or unique information inside a tooltip, because some users may never open it. See the accessibility guide for label and focus guidance.

API reference

PropTypeDefaultDescription
triggerReactElement—Element that opens the tooltip. Required. It must forward props and refs.
childrenReactNode—Short hint displayed in the popup. Required.
arrowbooleantrueWhether to render the directional arrow.
delaynumber600Delay before opening on hover, in milliseconds.
closeDelaynumber0Delay before closing, in milliseconds.
side"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""top"Preferred side of the trigger.
align"start" | "center" | "end""center"Alignment relative to the trigger.
sideOffsetnumber | OffsetFunction8Distance between the trigger and popup in pixels.
alignOffsetnumber | OffsetFunction0Offset along the alignment axis in pixels.
collisionPaddingPadding5px per sideSpace kept between the popup and the collision boundary.
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean, details) => void—Called when the tooltip opens or closes.
onOpenChangeComplete(open: boolean) => void—Called after the open or close animation finishes.
disabledbooleanfalsePrevents the tooltip from opening.
trackCursorAxis"none" | "x" | "y" | "both""none"Axis the tooltip follows while the pointer moves.
disableHoverablePopupbooleanfalseWhether the tooltip contents can be hovered without closing the tooltip.
actionsRefRefObject<Tooltip.Root.Actions | null>—Imperative close and unmount actions.
triggerIdstring | null—ID of the trigger for a controlled tooltip.
defaultTriggerIdstring | null—ID of the trigger for an initially open tooltip.
handleTooltip.Handle<Payload>—Handle that lets external triggers control the tooltip.
classNamestring—Tailwind classes merged into the popup.
styleCSSProperties—Inline styles merged into the same element as className.
ui{ positioner?: ClassValue; popup?: ClassValue; glass?: ClassValue; overlay?: ClassValue; arrow?: ClassValue; content?: ClassValue }—Tailwind classes for internal slots, keyed by data-slot.

ui keys map to the data-slot values listed below. Additional Base UI Tooltip.Root props are forwarded.

AttributeDescription
data-openPresent when the popup is open.
data-closedPresent when the popup is closed.
data-sideIndicates the resolved side (top, bottom, left, right, inline-start, or inline-end).
data-alignIndicates the resolved alignment (start, center, or end).
data-starting-stylePresent when the popup begins animating in.
data-ending-stylePresent when the popup is animating out.
data-instantPresent when animations should be skipped.
data-popup-openPresent on the trigger while the tooltip is open.
data-slotMarks internal parts (positioner, popup, glass, overlay, arrow, content).

Theming

The component uses the shared glass material. Tune shared --ui-glass-* tokens on a parent, use className for layout, and use ui for internal slots keyed by data-slot. Component-specific values live in src/theme/tooltip.ts. See the theming guide for token layers and presets.

  • Popover — For richer content, actions, and non-modal focus.
  • Button — The usual tooltip trigger.
  • Menu — For a list of actions anchored to a trigger.