A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
npx shadcn@latest add https://sdk-components.thesqd.com/r/tooltip.jsonimport { Tooltip } from "@/components/ui/tooltip";import { Button } from "@/components/ui/button";
import { Tooltip } from "@/components/ui/tooltip";
export function Example() {
return (
<Tooltip content="Edit profile" delay={150}>
<Button variant="outline">Hover me</Button>
</Tooltip>
);
}Tooltip (single component — pass content + child trigger)
├── content={<ReactNode>} (auto-emits Provider + Trigger + Content)
├── shortcut={<Kbd>⌘C</Kbd>} (rendered after the content body)
├── side / align / sideOffset / alignOffset
├── delay={150} (auto-mounts a TooltipProvider)
├── contentClassName (applied to the popup content)
└── children (the trigger element — wrapped via render={…})
Without `content`, Tooltip stays compound — drop in TooltipTrigger +
TooltipContent children manually. The slot exports — TooltipProvider,
TooltipTrigger, TooltipContent — remain available as the escape hatch.Activity growth — Incremental
What's included?
| Prop | Type | Default | Description |
|---|---|---|---|
content | ReactNode | — | Body of the tooltip. When set, switches to the flat layout (auto-mounts Provider + Trigger + Content). |
shortcut | ReactNode | — | Trailing keyboard hint — typically a `<Kbd>` element rendered after the content. |
side | "top" | "right" | "bottom" | "left" | "top" | Edge of the trigger to anchor against. |
sideOffset | number | 4 | Pixel gap between trigger and tooltip on the chosen side. |
align | "start" | "center" | "end" | "center" | Alignment along the chosen side. |
alignOffset | number | 0 | Pixel offset along the alignment axis. |
delay | number | — | Show delay in ms — applied via the auto-mounted TooltipProvider. |
contentClassName | string | — | Class names applied to the tooltip popup content. |
open | boolean | — | Controlled open state. |
onOpenChange | (open: boolean) => void | — | Fires when the tooltip opens or closes. |