npx shadcn@4.23.1 add @goop/trail-tooltipTooltip
FreeA short label shown on hover or focus that names an icon button or explains a control, for React and Tailwind CSS. Free, MIT.
What an agent sees
- TooltipProviderShares the delay before a tooltip shows among the tooltips inside it
- TooltipTriggerWhat the tooltip describes
- TooltipPanelThe tooltip's panel alone, with no trigger and no placing of its own
- TooltipPanelRowOne row of words in a
TooltipPanel - TooltipContentThe panel (
role="tooltip", the words that describe its trigger), placed above its trigger, flipping to stay inside the window
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipPanel, TooltipPanelRow, TooltipContent } from '@/components/ui/goop/tooltip';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
<Tooltip>
<TooltipTrigger asChild>
<IconButton variant="ghost" aria-label="Settings">
<IconButtonIcon icon="settings" />
</IconButton>
</TooltipTrigger>
<TooltipContent>Workspace settings</TooltipContent>
</Tooltip>Rest the pointer on the button or Tab to it: the tooltip shows; switch its side, its alignment, the wait, long words, or keep it open. The button opens nothing.
When to use
- A short label shown on hover or focus that names an icon button or explains a control.
- Also called: hint.
When not to use
- For a richer preview use HoverCard.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Tooltip on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.
npx shadcn@4.23.1 add @goop/trail-tooltipAdd the Goop Tooltip to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipPanel, TooltipPanelRow, TooltipContent } from '@/components/ui/goop/tooltip';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
<Tooltip>
<TooltipTrigger asChild>
<IconButton variant="ghost" aria-label="Settings">
<IconButtonIcon icon="settings" />
</IconButton>
</TooltipTrigger>
<TooltipContent>Workspace settings</TooltipContent>
</Tooltip>- Fits: list, board: overlay.
- width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| open? | boolean | |
| defaultOpen? | boolean = false | |
| onOpenChange? | (open: boolean) => void | |
| delayDuration? | number |
- State: open (open / defaultOpen / onOpenChange); drawn by data-state=open
| Part | What it is |
|---|---|
| TooltipProvider | Shares the delay before a tooltip shows among the tooltips inside it; also takes delayDuration?: number |
| TooltipTrigger | What the tooltip describes; takes asChild |
| TooltipPanel | The tooltip's panel alone, with no trigger and no placing of its own |
| TooltipPanelRow | One row of words in a TooltipPanel |
| TooltipContent | The panel (role="tooltip", the words that describe its trigger), placed above its trigger, flipping to stay inside the window; container?: HTMLElement | null — Where the layer is portalled; the end of <body> when left out |
- data-slot values (to select a part by): tooltip-content, tooltip-glide, tooltip-inner, tooltip-panel, tooltip-panel-row, tooltip-trigger
Keyboard
| Key | What it does |
|---|---|
| Escape | Dismiss |
Accessibility
- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| open | the attribute data-state=open |
Motion
- The part sets its own motion: add no transition or animation of your own.
- How the theme moves, and how to move your own parts the same way: Motion.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.