Tooltip

A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.

Demo

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import {
  TooltipProvider,
  Tooltip,
  TooltipTrigger,
  TooltipContent,
} from "@/components/ui/tooltip";

Sides

Anchor on top, right, bottom, or left with the side prop.

Dark previewReplay previewOpen in new tab

Keyboard Shortcut

Combine text with Kbd to hint a shortcut.

Dark previewReplay previewOpen in new tab

Disabled Button

Wrap a disabled control in a span so the tooltip still triggers.

Dark previewReplay previewOpen in new tab

API Reference

TooltipProvider

PropTypeDefaultDescription
delayDurationnumber700Hover delay before showing.
skipDelayDurationnumber300Window during which the next tooltip skips the delay.

Tooltip

PropTypeDefaultDescription
openboolean—Open state. Supports v-model:open.
EventDescription
update:openFires when the tooltip shows or hides.

TooltipTrigger

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto the child element.

TooltipContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""top"Anchor side.
sideOffsetnumber4Gap from the trigger in px.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
TabMoving focus onto the trigger shows the tooltip.
EscDismisses the tooltip while it is open.