Use it to label icon buttons and give short hints in toolbars, table headers and rails: what a
button does, its shortcut, what a metric means. A tooltip describes; it never names (icon buttons
still need an aria-label) and never holds anything people must act on or read to continue: hints
that need data or links belong in a popover, errors belong in the field's message.
Wrap the app once in Tooltip.Provider (a tooltip on its own also works). Tooltip.Trigger is
asChild by default, so your button stays your button and its handlers keep running. The shadcn
names are exported too: TooltipProvider, Tooltip, TooltipTrigger, TooltipContent.
Wrap a toolbar or a rail in Tooltip.Group: its tooltips share one capsule, so moving to the next
trigger within the skip delay makes the tooltip travel there as a stretching pill instead of
closing and pinching out again. Outside a group every tooltip pinches and contracts on its own.
temperament (calm, lively, playful) changes how springy the pinch, the settle and the
travel are; the look never changes.
Ball: 6 px, at the arrow point on the capsule's edge facing the trigger, centred on the
trigger (12 px from its corner with align="start" | "end"). It is the pinch and then the arrow;
with arrow={false} it is absorbed into the capsule.
Capsule:foreground on background, inverted in both themes, 28 px tall with a real 14 px
radius (sm: 24 px, radius 12), with a 1 px rim, one soft shadow tinted with the fill and an
inner top highlight.
Label: rides at the capsule's centre and never scales; it shows only once the capsule has
room for it.
Built on Radix Tooltip: the content has role="tooltip" and the trigger gets aria-describedby
while it is open. The drawn capsule, ball and label are aria-hidden; screen readers read the
description once, after the trigger's name. Pass aria-label on Tooltip.Content for a plain
announcement of rich markup.
A tooltip is a description, not a name: icon buttons still need aria-label (in development the
trigger warns when it has none). Empty content renders nothing and removes aria-describedby.
WCAG 1.4.13: dismissible (Escape), hoverable (the pointer can move onto the tooltip unless
disableHoverableContent), persistent until hover or focus leaves.
The tooltip never takes focus and opens 6 px off the trigger, so it never covers the trigger's
3 px focus ring.
Touch: Radix ignores touch, so a long-press (500 ms, cancelled by a move of more than 8 px) opens
the tooltip until the next tap anywhere; a normal tap still activates the trigger. A long-press is
not discoverable: touch layouts should also show visible labels.
Contrast: background on foreground is far above AA in every shadcn theme; the rich
description uses background at 80%, still above 4.5:1 in both themes. The rim keeps the capsule
distinct from a dark page.
With prefers-reduced-motion (or MotionKitProvider reducedMotion="always") there is no ball
growth, no stretch and no overshoot: the finished capsule, arrow ball attached, fades in at its
place and fades out on close. Inside a group it still glides to the next trigger in the fade time
while the label crossfades, so a toolbar sweep stays easy to follow. At rest it is exactly the
animated version's last frame.
Nothing runs while the tooltip is closed. While it is open, Radix positions an invisible box and
the drawing follows it: a mutation observer on its position and a resize observer, no per-frame
loop. The motion is two springs per axis for the capsule's edges, one for the ball and one for the
settle; the label is moved and faded, never scaled. Peers: motion and
@radix-ui/react-tooltip (about 6 kB gzip with its Popper and floating-ui).
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 6.6 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-tooltip, motion.
Dependencies
@radix-ui/react-tooltip · peer
motion · peer
Triggers
hover, keyboard focus, press
Reduced motion
No ball growth or overshoot: the finished capsule with its arrow ball fades in and out in place, and inside a group it glides to the next trigger while the label crossfades.
Keyboard
Tab / Shift + Tab
Focusing a trigger opens its tooltip at once; inside a Tooltip.Group the open tooltip travels to the newly focused trigger
Escape
Closes the tooltip; focus stays on the trigger
Enter / Space
Activates the trigger; the tooltip closes
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)