Tooltip is a compound component that displays a short label anchored to a trigger element. It opens after a configurable delay on hover, or immediately on focus, and closes when the pointer leaves or focus moves away.
Sub-components
| Component | Description |
|---|---|
Tooltip.Provider | Coordinates open/close timing across a group of tooltips. |
Tooltip.Root | Manages tooltip state and provides context to child components. |
Tooltip.Trigger | The element that activates the tooltip on hover or focus. |
Tooltip.Popup | The tooltip popup container with label content. |
Tooltip.Arrow | Optional decorative arrow pointing to the trigger. |
Import
Basic Usage
Grouping Tooltips
Wrap multiple tooltips inTooltip.Provider to share a delay group. Once one tooltip becomes visible, adjacent tooltips open instantly within the timeout window, skipping the normal delay.
Tooltip.Root Props
Controlled open state. When provided, the component operates in controlled mode.
Initial open state for uncontrolled usage. Defaults to
false.Milliseconds before the tooltip opens on hover. Defaults to
600.Milliseconds before the tooltip closes after the pointer leaves. Defaults to
0.Prevents the tooltip from opening.
When
true, the tooltip closes immediately when the pointer leaves the trigger (even if the pointer moves into the popup).Called when the open state changes. Fires immediately, before animations complete.
Called after open/close animations complete.
Tooltip.Trigger, Tooltip.Popup, and optionally Tooltip.Arrow elements.Tooltip.Provider Props
Time window in milliseconds during which adjacent tooltips open instantly after one has been shown. Defaults to
500.Tooltip.Root elements to group together.State Data Attributes
These attributes are reflected on theTooltip.Popup element.
| Attribute | Value / Description |
|---|---|
data-open | Present when the tooltip is open. |
data-side | "top" | "bottom" | "left" | "right" — current placement side. |
data-align | "start" | "center" | "end" — current alignment. |
data-starting-style | Present during the open animation. |
data-ending-style | Present during the close animation. |
CSS Styling Example
Accessibility
The trigger receivesaria-describedby pointing to the popup when open. The popup renders with role="tooltip" and popover="manual". Tooltips open on focus and close when focus leaves, ensuring keyboard-only users can access the label.