Basic usage
Properties
Tooltip content to display
Position of the tooltip relative to the element
Delay in milliseconds before showing tooltip
Disables the tooltip
Custom CSS class for the tooltip
Show tooltip on click instead of hover
Examples
- Basic tooltips
- Positions
- With delay
- Conditional tooltips
- Form field hints
- Truncated text
- Click to show
Custom styling
Default styling
Accessibility
The Tooltip component ensures accessibility:
role="tooltip"for proper semanticsaria-describedbylinks tooltip to trigger element- Shows on focus for keyboard users
- Dismisses on Escape key
- Screen reader compatible
- Respects
prefers-reduced-motion
Best practices
- Keep tooltip text concise (under 2 sentences)
- Use for supplementary information, not critical content
- Don’t hide important instructions in tooltips
- Ensure tooltips don’t cover interactive elements
- Use consistent positioning within sections
- Add delays to prevent accidental triggers
- Don’t use tooltips on mobile (use click instead)
- Provide keyboard access (show on focus)
- Use
autoposition for edge detection
When to use tooltips
✅ Good use cases:- Icon button labels
- Abbreviated text expansion
- Form field hints
- Disabled button explanations
- Feature descriptions
- Supplementary information
- Critical instructions
- Error messages
- Primary actions
- Mobile interfaces
- Long-form content
- Interactive content
Tooltip vs other components
| Component | Use case |
|---|---|
| Tooltip | Brief, supplementary information on hover |
| Popover | Rich content with interactions |
| Message | Persistent in-page alerts |
| Toast | Temporary notifications |
| Modal | Critical information requiring action |