Tooltip
A short label for a control on the tooltip tier of the float glass. It waits 600 ms for a deliberate hover, and its neighbours under one provider then open at once.
Installation
$ pnpm dlx shadcn@latest add @videorc/tooltipUsage
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";<Tooltip>
<TooltipTrigger
render={<Button aria-label="Keep on top" size="icon" variant="ghost" />}
>
<PinIcon />
</TooltipTrigger>
<TooltipContent>Keep on top</TooltipContent>
</Tooltip>Mount one TooltipProvider around each window. Tooltips under it share a delay group: once one is open, moving to the next opens it at once. A tooltip outside every provider still works, with its trigger's own 600 ms.
Anatomy
<TooltipProvider>
<Tooltip>
<TooltipTrigger />
<TooltipContent />
</Tooltip>
</TooltipProvider>Examples
With a shortcut
Put a Shortcut keys chip after the label to show the bound shortcut. The tooltip tightens its end padding around the chip.
Theming
| Token or attribute | Meaning |
|---|---|
glass-float-tooltip | The tooltip tier: the window's solid tone, a 1 px rim and the float drop |
rounded-row | 8 px corners |
text-xs | 12 px text, never an inverted pill |
data-open, data-closed | Fades and scales from 0.98 in 100 ms, with no slide |
data-side | The side it opened on |
Keyboard
| Key | Action |
|---|---|
Tab | Focusing the trigger opens its tooltip |
Escape | Closes the tooltip |
Accessibility
A tooltip is never the only place a fact lives, and title= is not an information channel. An icon-only trigger still needs its own aria-label: the tooltip repeats the name for sighted users. A disabled control takes no hover, so explain it with Disabled reason.
API reference
Every Base UI Tooltip prop, plus:
TooltipProvider
Prop
Type
TooltipContent
Prop
Type
Shortcut Tooltip
A control's tooltip with its bound shortcut as one keycap, keyboard-first and quiet. It wraps the control, so the tooltip never touches the control's own attributes.
Popover
A floating panel for a short task, on the popup tier of the float glass. An Anchor part lines it up with something other than its trigger.