Overview
The Tooltip component displays helpful information when users hover over or focus on an element. It’s implemented as a directive that can be applied to any element.Import
Basic Usage
Positioning
Disabled State
Input Properties
The text content to display in the tooltip
Position of the tooltip relative to the target element
Whether the tooltip is disabled
Features
- Auto-positioning: Automatically adjusts position to stay within viewport
- Keyboard accessible: Shows on focus, hides on blur or Escape key
- ARIA support: Proper
aria-describedbyrelationship - Smart alignment: Prevents overflow with fallback positioning
- Event listeners: Auto-cleanup on scroll, resize, and escape
Accessibility
- Uses
role="tooltip"for screen readers - Connects to host element via
aria-describedby - Responds to keyboard focus events
- Dismissible with Escape key
