Tooltip
SourceHints on hover and focus. The popup is a small popover surface with an arrow, on base-ui.
Overview
Tooltip wraps its own base-ui Provider, so one instance is one line. TooltipTrigger renders a button, TooltipContent renders into a portal.
The trigger has no face of its own. Put a Box inside for the visual, or pass render to attach the tooltip to another element. An anchor is the common case: AddressDisplay does exactly that.
TooltipProvider is re-exported for a group that composes base-ui parts directly. Wrapping Tooltip instances in it changes nothing, since each one carries its own provider.
Basic
<Tooltip> <TooltipTrigger>Hover me</TooltipTrigger> <TooltipContent>Helpful context</TooltipContent> </Tooltip>
Offset
sideOffset is the gap between the trigger and the popup, in px. The default is 4.
<TooltipContent sideOffset={4}>Default gap</TooltipContent>
<TooltipContent sideOffset={12}>A wider gap</TooltipContent>Delay
delay on the trigger sets how long a hover waits before the popup opens. Help icons want zero.
<TooltipTrigger delay={0}>Instant</TooltipTrigger>
<TooltipTrigger delay={1000}>Patient</TooltipTrigger>Tooltip props
Forwarded to base-ui's Tooltip.Root. The common props are listed.
Controlled open state. Pair with onOpenChange.
Open on first render, uncontrolled.
Fires on open and close, with the reason.
Never opens.
A TooltipTrigger and a TooltipContent.
TooltipTrigger props
base-ui's Tooltip.Trigger, unchanged.
Milliseconds before the tooltip opens on hover.
Milliseconds before it closes after the pointer leaves.
Close when the trigger is clicked.
Swap the button for another element, like an anchor. Props merge onto it.
TooltipContent props
Distance in px between the trigger and the popup.
The popup body. The arrow renders before it.
Bridge className for the popup. Tailwind product code only, it dies with the bridge.
Inline style for the popup, merged after the lens styles.