tsimport {XDSTooltip} from '@xds/core/Tooltip'
| Guidance | Practices |
|---|---|
| Do | Keep tooltip content concise — aim for under 140 characters of plain text. |
| Do | Add a tooltip to icon-only buttons and controls that lack a visible label. |
| Don't | Place interactive elements like links or buttons inside a tooltip — use HoverCard or Popover instead. |
| Don't | Use tooltips for essential information that users must see to complete a task. |
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Trigger element(s) that activate the tooltip. |
anchorRef | RefObject<HTMLElement> | External anchor ref for sibling mode. |
content | ReactNode | Tooltip content, typically short text. |
placement | LayerPlacement (default: 'above') | Position relative to the anchor element. |
alignment | LayerAlignment (default: 'center') | Alignment along the placement axis. |
delay | number (default: 200) | Show delay in milliseconds. |
hideDelay | number (default: 0) | Hide delay in milliseconds. |
focusTrigger | 'auto' | 'always' | 'never' (default: 'auto') | Controls when focus events trigger the tooltip. |
isEnabled | boolean (default: true) | Enables or disables the tooltip triggers. |
onOpenChange | (isOpen: boolean) => void | Callback fired when tooltip visibility changes. Called with true when shown and false when hidden. |
hasHoverIndication | 'auto' | boolean (default: 'auto') | Shows a dashed underline on the trigger element. |
isDefaultOpen | boolean | Whether the tooltip should be shown on mount. Still dismissible. |