ReferenceDisplay
Tooltip
A tooltip component for displaying contextual labels on hover and focus
Import
Anatomy
Behavior
Displays a short label anchored to a trigger element. Opens after a configurable delay (default 600ms) on hover or immediately on focus. Closes when the pointer leaves or focus moves away, with an optional closeDelay.
The side and align props control the preferred placement relative to the trigger. When the preferred side overflows the positioning boundary, the tooltip uses the opposite side if it has more space. Positioning uses CSS Anchor Positioning where supported, with a JavaScript measurement fallback.
The component is composed from six parts: Root manages state and context,
Trigger renders a button that activates the tooltip, Popup contains the label content,
Label renders the tooltip body, Shortcut renders an optional keyboard hint, and
Arrow renders a decorative pointer. Wrap multiple tooltips in a Tooltip.Provider
to coordinate open/close timing across a group — once a tooltip becomes visible, adjacent
tooltips open instantly within the timeout window, skipping the normal delay.
Tooltips inside a player container also observe its popup group. By default, a tooltip does not open—or closes if already open—while a menu or popover attached to the same trigger is open. Set sticky when the tooltip should remain visible with that trigger’s popup.
Tooltip.Provider coordinates tooltip delay timing only; it does not replace the container’s popup group.
Styling
Use CSS custom properties for positioning offsets:
React renders standard DOM elements. Add a className to style them:
Style based on open state, rendered side, and transition phases. data-side reflects the rendered side and can differ from the preferred side prop after collision handling:
Accessibility
Tooltips are visual-only, supplementary labels. The popup renders with role="presentation" and is not referenced by the trigger with aria-describedby. Give the trigger its own accessible name instead of relying on tooltip content. Built-in media buttons already expose a state-aware aria-label, and their tooltips reuse that translated label. Tooltips still open on focus so keyboard users who can see the label receive the same visual hint.
Examples
Basic Usage
Grouping
Wrap multiple tooltips in a Tooltip.Provider to share a delay group. Once a tooltip
becomes visible, adjacent tooltips open instantly within the timeout window, skipping
the normal delay.
API Reference
Root
Props
State
render, className, and style props.
Data attributes
CSS custom properties
Trigger
Element that triggers the tooltip on hover and focus. Renders a <button> element.
Props
Data attributes
Popup
Container for the tooltip content. Positioned relative to the trigger using CSS anchor positioning with a JavaScript fallback.
Props
Data attributes
Label
Tooltip body label; defaults to context content.label from the linked trigger.