Tooltip
A popup that displays information related to an element when it receives keyboard focus or the mouse hovers over it.
Usage
Tooltip Props
Prop | Type | Default |
---|---|---|
message | ReactNode | - |
children | ReactNode | - |
side | "top" | "right" | "bottom" | "left" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" |
disabled | boolean | false |
delayDuration | number | 200 |
skipDelayDuration | number | 200 |
className | string | - |
Examples
Side
The Tooltip component can be positioned in different directions using the side
prop:
Custom Content
Tooltips can contain custom content using ReactNode:
Accessibility
The Tooltip component follows WAI-ARIA guidelines for tooltips:
- Uses
role="tooltip"
for proper semantic meaning - Automatically manages focus and hover interactions
- Supports keyboard navigation
- Provides appropriate ARIA attributes for accessibility
- Manages enter/exit animations for smooth user experience