# Tooltip

> Hover/focus popover label, dismissible with Escape, WCAG 1.4.13-compliant.

- Group: Feedback
- Status: stable
- HTML page: https://design.ipmnx.com/components/tooltip/
- Spec: https://design.ipmnx.com/design/#nx-tooltip

## Preview

**On a ghost button**

```html
<span class="nx-tooltip">
  <button class="nx-btn nx-btn--ghost nx-btn--sm" tabindex="0"
      aria-describedby="tt-demo">Hover for tooltip</button>
  <span class="nx-tooltip__pop" role="tooltip"
      id="tt-demo">Tooltips invert per theme</span>
</span>
```

```tsx
<NxTooltip label="Tooltips invert per theme">
  <NxButton variant="ghost" className="nx-btn--sm">
    Hover for tooltip
  </NxButton>
</NxTooltip>
```

## API

### React props (NxKit)

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `label` | `ReactNode` |   | yes | The tooltip's text content. |

### Classes

| Class | Description |
| --- | --- |
| `.nx-tooltip` | Positioning wrapper |
| `.nx-tooltip__pop` | Popover: ink bg, paper text, hoverable + wraps (SC 1.4.13) |

## Accessibility

- Shows on both hover AND focus, stays hoverable (pointer-events:auto) so users can move into it, and is dismissible with Escape without losing the trigger's focus (WCAG 2.2 SC 1.4.13).
- The trigger gets exactly one tab stop (NxTooltip clones the child's tabIndex, doesn't add a second) + aria-describedby pointing at the tooltip's id.

## Do / Don't

- Do: Keep the tooltip text short and non-essential (never the only way to reach required info).
- Don't rely on hover alone. The same content must be reachable via keyboard focus.

## Related

- [Icon button](https://design.ipmnx.com/components/icon-button.md)

---

Source: registry.js (NX Design System)
