Tooltip

Composable hover, focus and tap tooltip with a subtle scale and fade, collision-aware side and alignment, an optional arrow, a pointer corridor onto hoverable content, one label at a time, keyboard-only focus reveal and optional cursor tracking.

Tooltip

tooltip.tsx

One-line shorthand: pass `content` and wrap the trigger element. Four sides with an arrow.

Hover or focus. Press Esc to dismiss.

Toolbar

tooltip.tsx

Composable parts under a shared provider. Icon-only buttons take their accessible name from the tooltip, later labels skip the delay, and a disabled control shows none.

The first label waits, the next ones open instantly. Click hides it until the pointer leaves.

API Reference

TooltipProvider

delay?
number

Delay before a hover opens a tooltip (ms).

—
closeDelay?
number

Delay before a tooltip closes once the pointer has left it (ms).

—
skipDelay?
number

After one tooltip closes, others open instantly for this long (ms).

—

TooltipTrigger

asChild?
boolean

Use the single child element as the trigger instead of rendering a button.

false
className?
string
—

TooltipContent

side?
"bottom" | "left" | "right" | "top"
top
align?
"start" | "end" | "center"
center
sideOffset?
number

Gap between anchor and tooltip (px).

—
arrow?
boolean

Draw an arrow pointing at the anchor.

false
anchorPoint?
TooltipPoint

Point within the anchor, as fractions of its rendered width and height.

—
className?
string
—

Tooltip

content?
ReactNode

Shorthand: the tooltip's content. With it, `children` is the trigger element; without it, compose `TooltipTrigger` and `TooltipContent`.

—
className?
string

Shorthand only: classes for the tooltip surface.

—
open?
boolean
—
defaultOpen?
boolean
—
onOpenChange?
((open: boolean) => void)
—
delay?
number

Delay before showing on hover (ms). Keyboard focus shows immediately.

—
closeDelay?
number

Delay before hiding once the pointer has left (ms).

—
disabled?
boolean

Never show, e.g. while the label it carries is already visible.

—
asLabel?
boolean

Use the tooltip as the trigger's accessible name rather than its description. For icon-only controls whose only label is the tooltip.

—
followCursor?
boolean

Follow real pointer coordinates; keyboard focus still uses the anchor.

—
anchorRef?
RefObject<TooltipAnchor | null>

Existing anchor for controlled integrations such as chart cells.

—
id?
string

Id of the tooltip surface, for anchors that reference it themselves.

—
side?
"bottom" | "left" | "right" | "top"
—
align?
"start" | "end" | "center"
—
sideOffset?
number

Gap between anchor and tooltip (px).

—
arrow?
boolean

Draw an arrow pointing at the anchor.

—
anchorPoint?
TooltipPoint

Point within the anchor, as fractions of its rendered width and height.

—

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/tooltip

Updated