# Tooltip primitive
Source: https://texuli.com/primitives-page/tooltip/
# Tooltip
A short description shown on hover or focus, after a delay.
Import
`import { Tooltip } from '@texuli/primitives/tooltip';`
Pattern
[Tooltip (WAI-ARIA APG)](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/)
Size budget
16.0 KiB gzip for @texuli/primitives/tooltip
Reference
`packages/primitives/docs/prim-tooltip.md`
## Live demo
Right to left
Loading the Tooltip demo…
## Anatomy
Tooltip anatomy: each box holds the parts inside it.
- `Tooltip.Provider``Tooltip.Root``Tooltip.Trigger`
- `Tooltip.Content`
## Behavior checks
`tests/behavior/scenarios/tooltip.spec.ts` runs **6 rows** against the Tooltip scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 6 rows
- the shown tip has the tooltip role
- hover shows it after the delay, not at once
- focus shows it
- while shown it describes the trigger
- Escape hides it and focus stays on the trigger
- moving the pointer away hides it
### Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 16.0 KiB gzip for `@texuli/primitives/tooltip` (`pnpm size`).
- Open-to-focus: p75 at most 150 ms (asserted with `TEXULI_PERF=1`).
Tooltip
A short description shown on hover or focus, after a delay.
- Import
import { Tooltip } from '@texuli/primitives/tooltip';- Pattern
- Tooltip (WAI-ARIA APG)
- Size budget
- 16.0 KiB gzip for @texuli/primitives/tooltip
- Reference
packages/primitives/ docs/ prim-tooltip.md
Loading the Tooltip demo…
Anatomy
Tooltip.ProviderTooltip.RootTooltip.TriggerTooltip.Content
Behavior checks
tests/behavior/scenarios/tooltip.spec.ts runs 6 rows against the Tooltip scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 6 rows
- the shown tip has the tooltip role
- hover shows it after the delay, not at once
- focus shows it
- while shown it describes the trigger
- Escape hides it and focus stays on the trigger
- moving the pointer away hides it
Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 16.0 KiB gzip for
@texuli/primitives/tooltip(pnpm size). - Open-to-focus: p75 at most 150 ms (asserted with
TEXULI_PERF=1).