Tooltip
A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
Installation#
pnpm dlx shadcn@latest add @davinciui/tooltipUsage#
Composition: TooltipProvider → Tooltip → TooltipTrigger + TooltipContent.
Placement: Use side="top | right | bottom | left" and align="start | center | end" on TooltipContent.
Disabled: Wrap disabled Button in <span tabIndex={0}> so tooltip can receive hover/focus.
Composition#
Use the following composition to build a Tooltip:
TooltipProvider
└── Tooltip
├── TooltipTrigger
└── TooltipContentAPI Reference#
| Prop | Type | Default |
|---|---|---|
TooltipProviderWraps tooltips to control delay. Props: delay. | Component | — |
TooltipRoot. | Component | — |
TooltipTriggerElement that triggers tooltip. Supports asChild. | Component | — |
TooltipContentPopup content. Props: side, align, sideOffset. | Component | — |
sidePreferred side. | "top" | "right" | "bottom" | "left" | "top" |
alignAlignment. | "start" | "center" | "end" | "center" |
classNameAdditional CSS classes. | string | — |
Accessibility#
Base UI opens the tooltip on pointer hover and keyboard focus, links it to the trigger with aria-describedby, gives the popup role=tooltip, and closes on Escape. Content should stay short and non-interactive because it is not focusable.
Motion#
The popup fades and scales from 95 percent with a 100ms CSS transition and animate-in classes. There is no reduced-motion handling, so the fade and zoom still run under prefers-reduced-motion.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

