# Tooltip

Brief hover-and-focus label built on Radix Tooltip. Renders on the shared popover surface with `text-caption` typography and φ-derived timing.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| TooltipProvider.delayDuration | number | 424 | Milliseconds before the tooltip opens on hover. |
| TooltipProvider.skipDelayDuration | number | 262 | Grace window in milliseconds when moving between adjacent tooltips. |
| TooltipContent.side | "top" \| "right" \| "bottom" \| "left" | "top" | Preferred placement relative to TooltipTrigger. |
| TooltipContent.sideOffset | number | 4 | Distance in pixels between trigger and tooltip bubble. |

## Sizes and tokens

| Tier / Role | Token | Value |
| --- | --- | --- |
| Bubble & text | --text-caption / --radius-sm / max-w-[15rem] | 12px caption · px-2 py-1 · radius-sm (4px) · 240px max width |
| Surface | --popover / --popover-foreground / --shadow-md / --z-dropdown | Step 3 surface · 1px border · shadow-md · z-index 20 |
| Timing & motion | 424ms delay · 262ms skip · --duration-162 / --duration-100 | Fade + scale 0.96→1 (162ms enter, 100ms exit); opacity-only when reduced |

## Code

```tsx
import {
  Button,
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from "@freshgemui/monoplinth";

export function Example() {
  return (
    <TooltipProvider>
      <Tooltip>
        <TooltipTrigger asChild>
          <Button variant="outline">Copy token</Button>
        </TooltipTrigger>
        <TooltipContent>Copy CSS custom property</TooltipContent>
      </Tooltip>
    </TooltipProvider>
  );
}
```

## Do and don't

- **Do: Always provide an accessible label on the trigger itself** — Give icon buttons an explicit aria-label so assistive technology and touch users never depend on TooltipContent alone.
- **Don't: Attach tooltips to disabled controls** — Disabled buttons do not receive keyboard focus; place explanatory text inline near the control instead.

## Accessibility

- Opens on both pointer hover and keyboard focus, and dismisses immediately on `Escape`.
- Never use `Tooltip` as the sole accessible name of an icon button; always pair with `aria-label` or visible text.
- Never attach `Tooltip` to `disabled` elements that cannot be focused by keyboard users.

## Rationale

Using the popover surface instead of an inverted fill keeps tooltips consistent with `Select` and `Popover` across all four brand themes, while `424ms` / `262ms` delays follow the φ motion scale.
