Tooltip
Tooltips reveal short contextual help without cluttering the surrounding interface.
Installation
Add the tooltip component to your project:
Usage
Default Tooltip
Tooltip
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Tooltip
Full preview from the registry iframe.
Loading preview...
Positioning
Tooltip
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Tooltip
Full preview from the registry iframe.
Loading preview...
Tooltip
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Tooltip
Full preview from the registry iframe.
Loading preview...
Without Arrow
Tooltip
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Tooltip
Full preview from the registry iframe.
Loading preview...
Custom Delay
Tooltip
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Tooltip
Full preview from the registry iframe.
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
content |
string |
'' |
Text shown inside the tooltip |
position |
string |
'top' |
Placement: top, bottom, left, or right |
delay |
int |
200 |
Delay in milliseconds before the tooltip appears |
arrow |
bool |
true |
Shows or hides the tooltip arrow |
Example Structure
<x-ui.tooltip content="Open project settings" position="right">
<x-ui.button variant="ghost" size="icon">?</x-ui.button>
</x-ui.tooltip>
Accessibility
- Role - Uses
role="tooltip"for the floating content - Pointer and focus support - Opens on hover and keyboard focus
- Progressive disclosure - Best for short guidance, not long-form content
Next Steps
- Explore Dialog component
- Learn about Popover component
- View Toggle component