Skip to content

Tooltip

A small label that appears near an element on hover or focus. Use to provide supplementary information for UI elements that lack a visible text label.

Basic

Tailwind v4
vue
<Tooltip content="This is a tooltip">
  <Button variant="secondary">Hover me</Button>
</Tooltip>

Placements

Tailwind v4
vue
<Tooltip content="Top tooltip" placement="top">
  <Button>Top</Button>
</Tooltip>
<Tooltip content="Right tooltip" placement="right">
  <Button>Right</Button>
</Tooltip>
<Tooltip content="Bottom tooltip" placement="bottom">
  <Button>Bottom</Button>
</Tooltip>
<Tooltip content="Left tooltip" placement="left">
  <Button>Left</Button>
</Tooltip>

On icon button

Tailwind v4
vue
<Tooltip content="Edit">
  <IconButton label="Edit">
    <PencilIcon />
  </IconButton>
</Tooltip>

Disabled

Tailwind v4
vue
<Tooltip content="This won't show" :disabled="true">
  <Button>...</Button>
</Tooltip>

With aria-describedby

Use the scoped slot to wire aria-describedby on the trigger — required for strict ARIA compliance.

Tailwind v4
vue
<Tooltip content="Saves your current work" v-slot="{ tooltipId }">
  <Button :aria-describedby="tooltipId">Save</Button>
</Tooltip>

Hide delay

Use hideDelay to keep the tooltip visible briefly after the pointer leaves — useful when the tooltip content itself might need to be re-entered, or just to reduce flicker on quick mouse-outs.

Tailwind v4
vue
<Tooltip content="Lingers for 500ms after you leave" :hide-delay="500">
  <Button>Slow to dismiss</Button>
</Tooltip>

Focus trigger

Use focus-trigger="never" to disable keyboard-focus activation entirely, so the tooltip only appears on hover (e.g. for purely decorative supplementary hints that shouldn't interrupt keyboard navigation).

Tailwind v4
vue
<Tooltip content="Only shows on hover" focus-trigger="never">
  <Button>Hover only</Button>
</Tooltip>

Props

PropTypeDefaultDescription
contentstringTooltip text
placement'top' | 'right' | 'bottom' | 'left''top'Where the tooltip appears
delaynumber300Milliseconds before showing
hideDelaynumber0Milliseconds before hiding, independent of delay. Re-entering the trigger before this timer fires cancels the hide
disabledbooleanfalsePrevent tooltip from showing
focusTrigger'auto' | 'always' | 'never''auto'Controls keyboard-focus activation. 'auto' shows on focus same as hover, 'always' forces focus-triggered display, 'never' disables the focusin/focusout listeners entirely so the tooltip only shows on hover
anchorRefHTMLElement | nullundefinedPositions the tooltip relative to this element instead of the wrapper span — useful when the trigger and the visual anchor point differ (e.g. a small icon inside a larger clickable row). Implemented with position: fixed computed from the anchor's bounding rect, recalculated on show and on window resize/scroll. It does not track the anchor on every animation frame, so it can drift out of sync during CSS transitions or scrolling inside a container that doesn't bubble a scroll event to window

Slots

SlotSlot propsDescription
defaulttooltipId: stringTrigger content. Use tooltipId to wire aria-describedby on the interactive element.

Private — Jetpack Labs internal use only