Shadcn.io is not affiliated with official shadcn/ui
Shadcn Tooltip
React tooltip for hover and focus hints on icon buttons. Built with TypeScript and Tailwind CSS for Next.js using Base UI — sides, shortcuts, and disabled triggers.
The shadcn tooltip is a short label on hover and keyboard focus. Use it for icon-only buttons, truncated cells, and why a control is disabled. It leaves on pointer-out, blur, or Escape.
Looking for a neobrutalism version for shadcn?
Same tooltip, thicker borders. The NeoBrutalism tooltip is the kit if you want that look.
Usage
import { Button } from "@/components/ui/button"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip"<Tooltip>
<TooltipTrigger render={<Button variant="outline" />}>
Hover
</TooltipTrigger>
<TooltipContent>
<p>Add to library</p>
</TooltipContent>
</Tooltip>render={<Button />} keeps the Button as the trigger. This wrapper sets delayDuration to 0 — it opens immediately.
Composition
TooltipProvider is optional. Each Tooltip already wraps one.
Side
side is top, right, bottom, or left. Collision still flips it if the viewport is tight.
With Keyboard Shortcut
Drop a Kbd in the content. It restyles itself on the inverted tooltip background.
Disabled Button
Disabled elements do not fire pointer events. Wrap the button in a span and put the trigger on the span.
RTL
Wrap with DirectionProvider and dir="rtl". side values stay physical — left is still left.
API
Prop
Type
TooltipContent
Prop
Type
TooltipTrigger takes render. TooltipProvider takes delayDuration and skipDelayDuration.
Keyboard
| Key | Action |
|---|---|
Tab | Open or close without delay |
Space / Enter | Close without delay if open |
Escape | Close without delay if open |
Notes
Disabled swallows the pointer
A disabled button does not receive hover or focus. Wrap it in a span and put TooltipTrigger on the span.
Keep the copy to a phrase. A paragraph belongs in a Popover or Hover Card.
With other components
Icon-only toolbar labels
KbdShortcut in the hint
ToggleWhy this is pressed
SidebarCollapsed nav labels
Input GroupTrailing help icon
BadgeStatus needs a sentence
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Toggle Group
React toggle group for formatting toolbars and view switchers. Built with TypeScript and Tailwind CSS for Next.js using Base UI — single or multiple, outline, and RTL.
Typography
React typography for headings, paragraphs, and lists. Built with TypeScript and Tailwind CSS for Next.js using Base UI — utility classes, no extra component file.