Tooltip
Hover-triggered tooltip with pointer; requires PopoverProvider in layout.
Installation
Add the Tooltip component using the CLI:
shadcnblazor component add tooltip
Usage
The Tooltip component displays a floating label on hover. Use Anchor for the trigger element (e.g., icon or button) and Content or ChildContent for the tooltip text. Requires PopoverProvider in your layout (already present in the docs).
Examples
Add to library
Simple tooltip with Content on an icon button.
Multiline
Use ChildContent for custom tooltip content (e.g., multiline text with line breaks).
API Reference
Tooltip
Hover-triggered tooltip that displays content above the trigger element.
Properties
| Name | Type | Description |
|---|---|---|
ContentClass |
string |
Additional CSS classes for the tooltip content. |
Offset |
int |
Gap in pixels between the tooltip and its trigger. |
DelayBeforeHideMs |
int |
Delay in milliseconds before the tooltip hides after mouse leave. |
DelayBeforeShowMs |
int |
Delay in milliseconds before the tooltip appears on hover. |
AdditionalAttributes |
Dictionary<string, Object> |
|
Class |
string |
|
Anchor |
RenderFragment |
Content rendered as the trigger element (e.g., icon or button). |
ChildContent |
RenderFragment |
The tooltip content (supports multiline text). |
Content |
string |
Simple text content for the tooltip (alternative to ChildContent). |
Methods
| Method | Returns | Description |
|---|---|---|
Dispose |
void |
|
Equals |
bool |
|
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |
Mobile support for API reference coming soon.