Tooltip

Tooltip

tooltip.tsx

Hover or focus. Press Esc to dismiss.

Toolbar

tooltip.tsx

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).

Default—
closeDelay?
number

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

Default—
skipDelay?
number

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

Default—

TooltipTrigger

asChild?
boolean

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

Defaultfalse
className?
string
Default—

TooltipContent

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

Gap between anchor and tooltip (px).

Default—
arrow?
boolean

Draw an arrow pointing at the anchor.

Defaultfalse
anchorPoint?
TooltipPoint

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

Default—
className?
string
Default—

Tooltip

content?
ReactNode

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

Default—
className?
string

Shorthand only: classes for the tooltip surface.

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

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

Default—
closeDelay?
number

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

Default—
disabled?
boolean

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

Default—
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.

Default—
followCursor?
boolean

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

Default—
anchorRef?
RefObject<TooltipAnchor | null>

Existing anchor for controlled integrations such as chart cells.

Default—
id?
string

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

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

Gap between anchor and tooltip (px).

Default—
arrow?
boolean

Draw an arrow pointing at the anchor.

Default—
anchorPoint?
TooltipPoint

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

Default—

Install

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

$ bunx --bun shadcn add @beui/tooltip

Updated