# Tooltip (`.z-tooltip`)

> Singleton text hint shown on hover or keyboard focus of any `data-tooltip` element, positioned with Floating UI.

- **Kind:** css
- **Category:** overlays

## Reference inventories

- [CSS Variables (14)](https://next.0build.dev/docs/components/tooltip/css-vars.md)
- [CSS Classes (2)](https://next.0build.dev/docs/components/tooltip/css-classes.md)

## Events

| Event | Cancelable | Detail | Description |
| --- | --- | --- | --- |
| `z-tooltip:hide` | — | `{ trigger: HTMLElement; tooltip: HTMLDivElement }` | Fires on the trigger when its tooltip is hidden, with the same detail shape as `show`. |
| `z-tooltip:show` | — | `{ trigger: HTMLElement; tooltip: HTMLDivElement }` | Fires on the trigger when its tooltip is shown. Detail carries `trigger` and `tooltip` (the shared tooltip element). |

## Data Hooks

| Attribute | Values | Applies to | Role | Description |
| --- | --- | --- | --- | --- |
| `data-side` | — | `descendant` | `marker` | Set by the singleton on the tooltip element to the resolved placement side (`top`, `bottom`, `left`, `right`); selects fixed positioning and the enter-animation direction. |
| `data-tooltip` | — | `external-trigger` | `config` | Activates the tooltip on the element. The value is the tooltip text, or an option string with `title`/`text`, `pos`/`placement`, `offset`, `delay`, `flip`, `shift`, `blur`, `cls`, and `stl`. A native `title` attribute is stashed and used as fallback text. |

## Keyboard

| Keys | Action | When |
| --- | --- | --- |
| `Escape` | Hides the visible (or pending) tooltip. | — |

## Notes

- One shared tooltip element is reused for every trigger; it is created on first use and kept positioned with Floating UI `autoUpdate`.
- Hover shows after `delay` (default 100 ms); moving to another trigger within 350 ms of the last hide shows immediately (warmup).
- Touch pointers are ignored, disabled triggers are skipped, and pointerdown hides the tooltip.
- Placement names map to Floating UI placements (`top-left` → `top-start`, etc.); `flip` and `shift` keep the tooltip inside the viewport.

## Guides

- [Styling with cls and stl](https://next.0build.dev/docs/guides/styling.md)
- [Translating Components](https://next.0build.dev/docs/guides/i18n.md)
- [Icon Resolution](https://next.0build.dev/docs/guides/icons.md)
- [The data-source Convention](https://next.0build.dev/docs/guides/data-source.md)
- [Openers & Triggers](https://next.0build.dev/docs/guides/triggers.md)
- [Dialog Behavior](https://next.0build.dev/docs/guides/dialogs.md)
- [Utilities](https://next.0build.dev/docs/guides/utilities.md)
- [Runtime](https://next.0build.dev/docs/guides/runtime.md)
