Tooltip
A short hint shown while the pointer rests on a control.
Installation
bash
shellui-native add tooltip
Platforms: MAUI · Avalonia.
Usage
Basic
<ui:Tooltip Text="Add to library">
<ui:Button Icon="Plus" Size="Icon" Variant="Outline" />
</ui:Tooltip>
<ui:Tooltip Text="Tooltips can sit below too" Placement="Bottom">
<ui:Button Text="Hover me" Variant="Outline" />
</ui:Tooltip><ui:Tooltip Text="Add to library">
<ui:Button Icon="Plus" Size="Icon" Variant="Outline" />
</ui:Tooltip>
<ui:Tooltip Text="Tooltips can sit below too" Placement="Bottom">
<ui:Button Text="Hover me" Variant="Outline" />
</ui:Tooltip>Not available on yet
MAUI and Avalonia
PlacementisToporBottomon MAUI; Avalonia takes its ownPlacementMode, soLeftandRightwork too.- On Avalonia the tooltip also shows while its control has keyboard focus.
- Touch screens have no hover, so tooltips don't show there.
API
XAML children go to Content.
| Property | Type | Default | Description |
|---|---|---|---|
Text |
string |
— | Tooltip text. |
Placement |
ShellPopupPlacement (MAUI) · PlacementMode (Avalonia) |
Top |
Side of the target the tooltip appears on. |
Delay |
int |
400 |
Milliseconds the pointer must rest before the tooltip shows. |
Content |
Control? |
null |
The control the tooltip belongs to. Avalonia only. |