# Tooltip

> A short hint shown next to its trigger.

- Category: [Overlays](https://tarve.dev/docs.md#overlays)
- Import: `import { Tooltip } from "@tarve/core";`
- Props type: `TooltipProps`
- Source: [packages/core/src/popups.ts:171](https://github.com/omarcosr/tarve/blob/main/packages/core/src/popups.ts#L171)

## Usage

```tsx title="Tooltip.tsx"
import { Button, Tooltip } from "@tarve/core";

let open = true;

<Tooltip
  id="save-tip"
  open={open}
  side="top"
  trigger={<Button>Save</Button>}
  content="Save (Ctrl+S)"
  onOpenChange={(next) => {
    open = next;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `content` (required) | `Child` | — |  |
| `id` (required) | `string` | — |  |
| `trigger` (required) | `Child` | — |  |
| `contentStyle` | `Style` | — |  |
| `label` | `string` | — |  |
| `onOpenChange` | `(open: boolean) => void` | — |  |
| `open` | `boolean` | — | Controlled visibility. Omit it and the tooltip shows while its trigger is hovered, one at a time. |
| `side` | `PopupSide` | `"top"` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="PopupSide"
type PopupSide = "top" | "right" | "bottom" | "left";
```

Previous: [Flyout](https://tarve.dev/docs/components/Flyout.md) · Next: [HoverCard](https://tarve.dev/docs/components/HoverCard.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Tooltip · Index for agents: https://tarve.dev/llms.txt
