Vesyl UI

Tooltip

A small label that appears on hover or focus to explain a control. Built on base-ui Tooltip — focus handling, hover intent, and ARIA wiring come for free.

Compose three parts: Tooltip (root), TooltipTrigger (the element that reveals it — pass an interactive control via render so the tooltip is keyboard-reachable), and TooltipContent (the label, portaled with an arrow). Each Tooltip self-wraps in a TooltipProvider, so a single tooltip needs no extra setup; wrap a group in your own TooltipProvider only to share the open delay between them.

Reach for a tooltip for short, non-interactive labels keyed to a control. For richer, hoverable content — avatars, summaries, links — use HoverCard; for click-triggered interactive panels use Popover.

Basic

A Tooltip wraps a trigger and its content. Pass the trigger control through render on TooltipTrigger so the tooltip opens on both hover and keyboard focus. Hover (or tab to) the button to reveal the label.

Positioning

TooltipContent accepts side ("top" default, "right", "bottom", "left") to choose where it opens relative to the trigger, plus sideOffset for the gap and align / alignOffset to shift it along that edge. The arrow tracks the chosen side automatically.

Shared delay

By default each tooltip opens instantly (delay={0}). Wrap a group of triggers in a TooltipProvider to give them a shared open delay — once one tooltip in the group has opened, its neighbors open instantly until the group’s timeout elapses. This is the icon-toolbar pattern: a brief hesitation before the first label, then snappy hops between buttons.

Reference

Tooltip

Root container. Self-wraps in a TooltipProvider. Extends base-ui Tooltip.Root props.

PropTypeDefaultDescription
defaultOpenbooleanfalseWhether the tooltip is initially open (uncontrolled)
openbooleanControlled open state
onOpenChange(open, eventDetails) => voidFires when the tooltip opens or closes
disabledbooleanfalseDisables the tooltip
disableHoverablePopupbooleanfalseWhen false, the popup can be hovered without closing
trackCursorAxis"none" | "x" | "y" | "both""none"Which axis the tooltip follows the cursor on

TooltipTrigger

The element that reveals the tooltip. Pass an interactive control through render so it stays keyboard-reachable. Extends base-ui Tooltip.Trigger props.

PropTypeDefaultDescription
renderReactElement | (props) => …Renders the trigger as this element (e.g. a Button) instead of the default span

TooltipContent

The label. Portaled, with an arrow that tracks side. Extends base-ui Tooltip.Popup props plus the positioning props below.

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""top"Which side of the trigger the tooltip opens on
sideOffsetnumber4Gap in px between the trigger and the tooltip
align"start" | "center" | "end""center"Alignment along the chosen side
alignOffsetnumber0Shift in px along the alignment axis
classNamestringMerged onto the popup

TooltipProvider

Optional. Shares an open delay across the tooltips it wraps. Extends base-ui Tooltip.Provider props.

PropTypeDefaultDescription
delaynumber0How long to wait, in ms, before opening a tooltip
closeDelaynumberHow long to wait, in ms, before closing a tooltip
timeoutnumber400Within this window after one tooltip closes, the next opens instantly
delayDurationnumberDeprecated. Use delay instead