A component that displays informative text when users hover over or focus on an element.
Guidelines
React API Reference
Blazor API Reference
Tooltips provide brief, context-sensitive information that appears when a user hovers over or focuses on an element. They help users understand icons, buttons, or form fields by offering additional details without cluttering the interface.
Use tooltips to clarify non-obvious functions or provide short, helpful
explanations. * Keep messages brief and easy to understand.
Don't
Present critical information that users must see to complete a task; that
should be visible without interaction. * Repeat what’s already obvious from
the interface.
Ensure accessibility by making tooltips keyboard navigable and screen reader friendly. Refer to ARIA guidelines and follow best practices for inclusive design.
1
Add the Provider
In your application’s root component, wrap your app with the TooltipProvider component.
@inject TooltipService tooltipService<StudsButton Text="Hover me" MouseEnter="@(args => ShowTooltip(args, new TooltipOptions(){ Text = "This is a tooltip", Position = TooltipPosition.Bottom }))" />@code { void ShowTooltip(ElementReference elementReference, TooltipOptions options = null) => tooltipService.Open(elementReference, "This is a tooltip", options);}