Tooltip

Headless tooltip primitives for contextual hover/focus hints.

Stable direction
@lattice-ui/tooltip

Part of the stable direction toward v1.0.

What It Is For

Use Tooltip for short contextual hints that appear on hover or selection focus without interrupting the surrounding workflow.

It is best for explaining nearby UI affordances, not for delivering required instructions or deep interaction flows.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add tooltip

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add tooltip

npm package: @lattice-ui/tooltip

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Providers

  • @lattice-ui/layer:PortalProvider? (optional)

Registry notes

  • Tooltip content can be portal-mounted for better overlap behavior.

Public Exports

  • Tooltip
  • Tooltip.Provider
  • Tooltip.Root
  • Tooltip.Trigger
  • Tooltip.Portal
  • Tooltip.Content

State Model

  • Tooltip.Provider tracks open-delay policy with delayDuration and skipDelayDuration across multiple tooltips.
  • Tooltip.Root can be controlled or uncontrolled and keeps refs for both the trigger and the positioned content.
  • Tooltip activity can come from hover or focus/selection, and the provider decides whether the next tooltip should open with a shorter skip delay.

Key API

Tooltip.Provider

Use provider-level delay settings when multiple tooltips in one region should feel consistent and benefit from skip-delay behavior.

Tooltip.Root

Use open, defaultOpen, delayDuration, and onOpenChange when one tooltip needs explicit state ownership.

Tooltip.Content

Use placement, offset, padding, and outside-interaction hooks to position the hint surface without rebuilding overlay math.

Composition Patterns

Dense control hints

Wrap icon-only or compact controls with tooltips when nearby text would create too much layout noise.

Shared timing regions

Use one provider around a toolbar or command strip so moving between nearby controls feels responsive instead of repeatedly delayed.

Cautions / Limits

  • Tooltips should stay short and supplemental; do not hide required instructions or destructive confirmations inside them.
  • Like other anchored overlays, tooltips benefit from a shared PortalProvider for predictable mounting and stacking.
  • Use motion for delay-aware entrance and exit behavior, but keep required instructions outside tooltip-only UI.