Popoveralternative
Use Popover for interactive or longer contentTooltip
Contextual help text that appears on hover or focus. Perfect for explaining icons, truncated text, or providing additional context.
Setup
import { Tooltip } from '@fragments-sdk/ui';Examples
Default
Basic tooltip on hover
Loading preview...
Positions
Tooltips on different sides
Loading preview...
With Shortcut
Tooltip showing keyboard shortcut
Loading preview...
No Arrow
Tooltip without arrow
Loading preview...
With Content Props
Pass popup attributes/styling using contentProps
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | element | Not set | The element that triggers the tooltip |
contentRequired | node | Not set | Content to display in the tooltip |
side | enumtopbottomleftright | top | Which side to show the tooltip |
align | enumstartcenterend | center | Alignment along the side |
sideOffset | number | 6 | Distance from trigger in pixels |
delay | number | 400 | Delay before showing (ms) |
closeDelay | number | 0 | Delay before hiding (ms) |
disabled | boolean | false | Disable the tooltip |
arrow | boolean | true | Show arrow pointing to trigger |
open | boolean | Not set | Controlled open state |
defaultOpen | boolean | false | Default open state |
onOpenChange | function | Not set | Callback when open state changes |
closeOnClick | boolean | false | Whether clicking the trigger closes the tooltip. |
contentProps | object | Not set | Props forwarded to the tooltip popup element (preferred way to pass popup attrs/className/style) |
style | object | Not set | — |
Usage Guidelines
When to use
- Explaining icon-only buttons
- Showing full text for truncated content
- Providing keyboard shortcuts
- Brief contextual help that fits in one line
When not to use
- Long-form help content (use Popover)
- Critical information users must see (use Alert)
- Interactive content (use Popover or Menu)
- Mobile-primary interfaces (tooltips require hover)
Best practices
- Keep tooltip text concise (under 80 characters)
- Use sentence case, no period for single sentences
- Avoid duplicating visible label text
- Consider mobile users who cannot hover
- Use contentProps for tooltip popup attributes/styling; top-level HTML attrs are applied to the popup for backward compatibility
Accessibility
- Accessible via focus as well as hover
- Uses role="tooltip" with proper aria association
- Delay prevents tooltips from appearing during navigation