Tooltip shows a short hint beside a control. It appears after a brief delay on hover or focus. Escape dismisses the hint. Use it for supplementary information, not essential instructions.
Browser support
Feature
Baseline
Your browser
Popover
Displays content in the browser top layer.
Your browser:
Anchor positioning
Positions content by its trigger; JavaScript positions it when anchors are unavailable.
Your browser:
@starting-style
Animates entry when supported; otherwise content appears immediately.
Your browser:
Preview
Helpful information
Installation
Usage
import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"
<Tooltip>
<TooltipTrigger asChild><button>Details</button></TooltipTrigger>
<TooltipContent side="top">Helpful information</TooltipContent>
</Tooltip>Examples
Position
Helpful information
<TooltipContent side="right">Helpful information</TooltipContent>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| side | "top" | "bottom" | "left" | "right" | "top" | Preferred side of the trigger. |
| align | "start" | "center" | "end" | "center" | Alignment along the trigger. |
| sideOffset | number | 4 | Distance from the trigger in pixels. |
| asChild | boolean | false | Use the child as the trigger. |
| hidden | boolean | false | Prevent the tooltip from opening. |