Tooltip
A short hint on hover and keyboard focus.
Staticimport { Tooltip } from 'umbra-ui'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children required | ReactElement<unknown, string | JSXElementConstructor<any>> | — | The trigger: a single focusable element such as a Button or IconButton. |
content required | ReactNode | — | Text shown in the bubble. Keep it short; it supplements, never replaces, the trigger's accessible name. |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
delay | number | 400 | Delay before showing on hover, in ms. Keyboard focus shows it immediately. |
onOpenChange | ((open: boolean) => void) | — | Called when the tooltip shows or hides. |
open | boolean | — | Controlled open state. |
Usage notes
The child must be a single focusable element.
Accessibility
- Shown on hover (after
delay) and immediately on keyboard focus; Escape dismisses. - Linked to the trigger with
aria-describedby: it supplements the accessible name, so icon-only triggers still needaria-label. - Hovering the tooltip itself keeps it open (WCAG 1.4.13).
Import
import { Tooltip } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app