Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Tooltip

Tooltip

Tooltip.vue

Hover or focus. Press Esc to dismiss.

Toolbar

Tooltip.vue

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—
#default?
slot
Default—

TooltipTrigger

asChild?
boolean

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

Defaultfalse
class?
string
Default—
#default?
slot
Default—

TooltipContent

side?
TooltipSide
Default—
align?
TooltipAlign
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—
class?
string
Default—
#default?
slot
Default—

Tooltip

content?
string

Plain-text content; use the `#content` slot for anything richer.

Default—
class?
string

Shorthand only: classes for the tooltip surface.

Default—
v-model:open?
boolean | undefined
Default—
defaultOpen?
boolean
Defaultfalse
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.

Defaultfalse
asLabel?
boolean

Use the tooltip as the trigger's accessible name rather than its description.

Defaultfalse
followCursor?
boolean

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

Defaultfalse
anchorRef?
HTMLElement | null | { value: HTMLElement | null }

Anchor an element you already have (for example a chart cell) instead of a trigger. The tooltip then does not listen to it: drive `v-model:open` yourself.

Default—
id?
string

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

Default—
side?
TooltipSide
Defaulttop
align?
TooltipAlign
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—
contentClass?
string
Default—
label?
string

Accessible name for the trigger (legacy; prefer `asLabel`).

Default—
shortcut?
string

`aria-keyshortcuts` for the trigger.

Default—
pressed?
boolean | null

`aria-pressed` for the trigger when not null/undefined.

Defaultundefined
toolbar?
boolean

Accepted for backward compatibility; the trigger element is now yours.

Default—
@activate?
(event: MouseEvent) => void
Default—
@show?
() => void
Default—
@hide?
() => void
Default—
#default?
slot
Default—
#content?
slot
Default—

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/tooltip

Import the shared styles once in your application.

TSUsage
import Tooltip from '@/components/beui/controls/tooltip/Tooltip.vue'
import '@/components/beui/styles.css'

Updated