Skip to Content
ComponentsTooltip

Tooltip

Tooltip shows a Windows 98 info popup for hover and focus targets. Compose a TooltipTrigger around the target with a TooltipContent for the popup.

Composition

Use the following composition to build a Tooltip:

Tooltip ├── TooltipTrigger └── TooltipContent

Props

Tooltip

The root. Owns visibility state; renders no element of its own.

PropTypeDefaultDescription
delaynumber400Delay before showing on hover/focus, in milliseconds.
openboolean-Visible state (controlled).
defaultOpenbooleanfalseInitial visible state (uncontrolled).
onOpenChange(open: boolean) => void-Called when the tooltip shows or hides.

TooltipTrigger

Wraps the hover/focus target in an inline-flex span and anchors the popup. Accepts native span props.

TooltipContent

The portalled popup. Accepts native span props plus:

PropTypeDefaultDescription
side'top' | 'bottom' | 'left' | 'right''top'Preferred placement, with viewport flipping.

Examples

Hover and focus hints

Viewport edge detection

ARIA

The trigger gains aria-describedby while the tooltip is visible, pointing at the role="tooltip" popup.

Keyboard

Focusing the trigger shows the tooltip after the configured delay. Escape dismisses the visible tooltip.

SSR

Tooltip portals after mount. Keep the trigger markup stable across server and client.

Last updated on