Tooltip
Short labels for icon buttons and shortcuts, on hover and keyboard focus.
ComponentsRadix Tooltip
Preview theme
Playground
Hover or focus the button. The delay is set on a local TooltipProvider; the app-wide provider uses 250ms, and moving between triggers skips the delay.
Preview
Props
Side
Align
Delay
Side offset
example.tsxtsx
1import { Share2 } from "lucide-react"2import { Button } from "@/components/ui/button"3import { Kbd } from "@/components/ui/kbd"4import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"56<TooltipProvider delayDuration={250}>7 <Tooltip>8 <TooltipTrigger asChild>9 <Button variant="outline" size="icon" aria-label="Share">10 <Share2 />11 </Button>12 </TooltipTrigger>13 <TooltipContent sideOffset={4}>14 Share15 <Kbd>⇧⌘S</Kbd>16 </TooltipContent>17 </Tooltip>18</TooltipProvider>States
Trigger states with the bubble drawn in place. A tooltip names or explains its trigger; it never carries the only copy of an error.
States
- Default
rest - ShareHover
:hover + delay - Share ⇧⌘SFocus
no delay on focus - Saving changes…Loading
aria-busy - Only owners can shareDisabled
span wrapper - Sync failed 2 min agoError
aria-invalid - CopiedSuccess
data-state=success
Patterns
Labels for an icon toolbar, a reason on a disabled button, and full text for names that only get a tooltip when they are actually truncated.
Icon toolbar with shortcuts
Hover one button, then slide along the row.
Explain a disabled button
Add a title before publishing
Full text for truncated names
Column width
Keyboard
- Focus the trigger and show the tooltip
- Tab
- Dismiss without moving focus
- Esc
Semantics and ARIA
- Opens on hover and on keyboard focus. The content has
role="tooltip"and the trigger points to it witharia-describedbywhile it is open. - A tooltip is a description, not a name: icon buttons still need their own
aria-label, usually the same words. - Touch devices have no hover, so tooltips must not hold essential information. Put errors, prices and instructions on the page.
- Keep it short and non-interactive. Links or buttons inside belong in a popover or hover card.
- Disabled buttons don’t receive pointer or focus events. Wrap them in a focusable
span, or usearia-disabledon a focusable button instead. - The bubble stays open while the pointer moves onto it (WCAG 1.4.13 hoverable) and Esc dismisses it (dismissible).