---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Tooltip

A short label shown on hover or focus that names an icon button or explains a control, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Tooltip`.

## Try it

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.

```sh
npx shadcn@4.23.1 add @goop/trail-tooltip
```

```text
Add the Goop Tooltip to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
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

### Options

- `open?: boolean`
- `defaultOpen?: boolean = false`
- `onOpenChange?: (open: boolean) => void`
- `delayDuration?: number`

- State: open (open / defaultOpen / onOpenChange); drawn by data-state=open

### Parts

- `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

- Escape: dismiss

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- open: the attribute data-state=open

## Motion

- The part sets its own motion: add no transition or animation of your own.

## 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.

## Related

- [Hover card](/themes/trail/components/hover-card): A small card previewing a person or a record while the pointer rests on its name.
- [Icon button](/themes/trail/components/icon-button): A button whose only visible label is one icon, for toolbars, rows and headers.
- [Dropdown menu](/themes/trail/components/dropdown-menu): A menu of actions.
- [Context menu](/themes/trail/components/context-menu): A menu of a target's secondary actions, opened at the pointer.
