Tooltip
Hover affordance hint with placement options.
Tooltip — hover/focus hint anchored to its trigger child. Backed by Radix `Tooltip`, which owns the parts a design system should not be maintaining itself: open/close state, the pointer delay, opening on keyboard focus and closing on blur/Escape/scroll, the portal, collision detection against the viewport, and the `aria-describedby` ↔ `role="tooltip"` association. The previous implementation was CSS-only — a `group` wrapper plus `group-hover:block` / `group-focus-within:block` — which meant no portal (so the bubble was clipped by any `overflow:hidden` ancestor), no collision handling (so it ran off-screen at the edges), no dismissal, and no delay. The wrapper `<div>` stays, and keeps `group relative inline-flex`: it is where `className` and the rest of `HTMLAttributes<HTMLDivElement>` land, so removing it would silently drop props callers already pass. Positioning no longer depends on it. The bubble keeps `whitespace-nowrap`, so rich `content` does not soft wrap by itself — long multi-line content needs an explicit `<br />`, or a `whitespace-normal` + width class on the node you pass in. Dropping `whitespace-nowrap` here would re-wrap every existing single-line string tooltip, so it stays opt-out rather than opt-in.
packages/ui/src/components/ui/tooltip.tsx
@marktiderman/genesis-uiimport { Tooltip } from "@marktiderman/genesis-ui";@marktiderman/genesis-ui.- Tooltip
react-docgen-typescript.Tooltip
Tooltip — hover/focus hint anchored to its trigger child. Backed by Radix `Tooltip`, which owns the parts a design system should not be maintaining itself: open/close state, the pointer delay, opening on keyboard focus and closing on blur/Escape/scroll, the portal, collision detection against the viewport, and the `aria-describedby` ↔ `role="tooltip"` association. The previous implementation was CSS-only — a `group` wrapper plus `group-hover:block` / `group-focus-within:block` — which meant no portal (so the bubble was clipped by any `overflow:hidden` ancestor), no collision handling (so it ran off-screen at the edges), no dismissal, and no delay. The wrapper `<div>` stays, and keeps `group relative inline-flex`: it is where `className` and the rest of `HTMLAttributes<HTMLDivElement>` land, so removing it would silently drop props callers already pass. Positioning no longer depends on it. The bubble keeps `whitespace-nowrap`, so rich `content` does not soft wrap by itself — long multi-line content needs an explicit `<br />`, or a `whitespace-normal` + width class on the node you pass in. Dropping `whitespace-nowrap` here would re-wrap every existing single-line string tooltip, so it stays opt-out rather than opt-in.
| Prop | Type | Default | Description |
|---|---|---|---|
| content* | ReactNode | — | Tooltip body. Accepts any `ReactNode` — icons, formatted or multi-line content — not just a plain string. |
| delayDuration | number | 0 | Milliseconds a POINTER must rest on the trigger before the tooltip opens. Keyboard focus is never delayed — Radix opens instantly on focus regardless of this value. Defaults to `0` rather than Radix's own `700`: the CSS-only implementation this replaced revealed the bubble the instant the pointer entered, and inheriting a 700ms delay on upgrade would read as the tooltip having broken. Raise it to get the "don't fire while the cursor sweeps across the UI" behaviour the hand-rolled version could not offer. |
| side | enum | top |