---
title: "Tooltip"
description: "A short label that shows when people point at a control or tab to it, such as the name of an icon button. It can have an arrow."
url: https://gelatinui.com/components/tooltip
markdown_url: https://gelatinui.com/components/tooltip.md
access: free
install: "npx shadcn@latest add @gelatin-ui/tooltip"
registry_item: https://gelatinui.com/r/tooltip.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Tooltip

> A short label that shows when people point at a control or tab to it, such as the name of an icon button. It can have an arrow.

Page: https://gelatinui.com/components/tooltip

## When to use it

Best for: A short label of a control on hover and keyboard focus, such as the name of an icon button.

- Use it for a short label of a control, such as the name of an icon button.
- Keep the same text in the `aria-label` of an icon button: touch screens do not show the tooltip.
- On a disabled Button, set `wrap` on the trigger and `focusableWhenDisabled` on the Button.

## When not to use it

- For more text, a link, or a control, use a popup that opens on a click: a tooltip holds only a short label.
- For a shortcut in text, use a [Kbd](https://gelatinui.com/components/kbd.md).

## Notes for agents

- Render the control through `render` on `TooltipTrigger`, inside a `TooltipProvider`.
- Touch screens do not show it: an icon button keeps its own `aria-label` with the same words.

## Anatomy

```text
Tooltip
├─ TooltipProvider (0..n)
├─ TooltipTrigger (0..n)
├─ TooltipContent (0..n)
└─ TooltipViewport (0..n)
```

## API reference

### Tooltip

Also takes every prop of Base UI `Tooltip.Root`: https://base-ui.com/react/components/tooltip

### TooltipTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `wrap` | `boolean` | false | Render the trigger as an `inline-flex` span around its children, in place of `render`: for a disabled Button that shows why it is off. See the JSDoc of `TooltipTrigger`. Default `false`. |

Also takes every prop of Base UI `Tooltip.Trigger`: https://base-ui.com/react/components/tooltip

### TooltipContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` | false | Show an arrow that points at the trigger. The gap grows from 6px to 10px. |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `arrowProps` | `PopupPartProps<TooltipArrowProps>` |  |  |

Also takes every prop of Base UI `Tooltip.Positioner`: https://base-ui.com/react/components/tooltip

### TooltipViewport

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Tooltip.Viewport`: https://base-ui.com/react/components/tooltip

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TooltipProvider | `tooltip-provider` |  |  |  |
| Tooltip | `tooltip` |  |  |  |
| TooltipTrigger | `tooltip-trigger` |  |  |  |
| TooltipContent | `tooltip-content` |  | `--popup-pad-x` |  |
| TooltipViewport | `tooltip-viewport` |  |  |  |

## Usage

Render the control through `render` on `TooltipTrigger`. Touch screens do not show the tooltip, so an icon button keeps its own `aria-label`.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/tooltip @gelatin-ui/button
```

```tsx title="copy-link-button.tsx"
import { CopyIcon } from "@phosphor-icons/react/ssr";

import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";

export function CopyLinkButton() {
  return (
    <TooltipProvider>
      <Tooltip>
        <TooltipTrigger render={<Button variant="ghost" size="icon" aria-label="Copy link" />}>
          <CopyIcon />
        </TooltipTrigger>
        <TooltipContent side="bottom" arrow>
          Copy link
        </TooltipContent>
      </Tooltip>
    </TooltipProvider>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/tooltip
```

It adds 14 registry items: 11 files, 1938 lines, and the npm packages `@base-ui/react`, `clsx`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Button](https://gelatinui.com/components/button.md)
- [Kbd](https://gelatinui.com/components/kbd.md)
- [Popover](https://gelatinui.com/components/popover.md): Pick Popover for more text, a link, or a control: it opens on a click and holds interactive content.
- [Hover Card](https://gelatinui.com/components/hover-card.md): Pick Hover Card for a rich preview of a link, such as a person or a page, with more than a short label.

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Opens the tooltip when the trigger gets focus. |
| Esc | Closes the tooltip. |

## Accessibility

`TooltipContent` is a Base UI `Tooltip.Popup`. It opens on hover and on keyboard focus of the trigger, after a 600ms delay, and closes on Esc.

Touch screens do not show the tooltip, so it never holds the only copy of the text. Give an icon button an `aria-label` with the same words.

On a disabled Button, set `wrap` on `TooltipTrigger` and `focusableWhenDisabled` on the Button. The Button stays in the tab order, so keyboard users can still learn why it is off.

The arrow is hidden from screen readers (`aria-hidden`).

## Motion

| Part | Motion |
| --- | --- |
| Open | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in, scales from 95%, comes 4px from the trigger |
| Close | popup-exit · 120ms · ease-out (0, 0, 0.2, 1) |
| Keyboard open, Esc, and a swap in a group | none · it shows and hides at once |
