Tooltip

in namespace DotVVM.BusinessPack.Controls

Usage & Scenarios

Tooltip shows text or formatted content near the pointer when it enters an element with the tooltip-trigger CSS class. The tooltip hides when the pointer leaves.

Sample 1: Showing a text hint

Hover over the reference to display Text. Bind IsDisplayed to a Boolean property to observe when the tooltip opens and closes.

The trigger class is matched across the document. A single tooltip can serve several triggers; placing a tooltip next to an element does not pair them.

<span class="tooltip-trigger">Hover over reference INV-1042</span>
<bp:Tooltip Text="{value: ReferenceHint}" IsDisplayed="{value: HintVisible}" />
<p>Tooltip visible: {{value: HintVisible}}</p>
using DotVVM.Framework.ViewModel;

namespace DotvvmWeb.Views.Docs.Controls.businesspack.Tooltip.sample1
{
    public class ViewModel : DotvvmViewModelBase
    {
        public string ReferenceHint => "Include this reference when contacting support.";
        public bool HintVisible { get; set; }
    }
}

Sample 2: Formatting tooltip content

Use Template instead of Text to include markup. Hover over the field label to see an example with the prefix emphasized.

<label class="tooltip-trigger">Invoice reference: <input type="text" /></label>
<bp:Tooltip>
    <Template>Start with <strong>INV-</strong>, for example <code>INV-1042</code>.</Template>
</bp:Tooltip>

Properties

Name Type Description Notes Default Value
property icon IsDisplayed Boolean
attribute
inner element
static value
bindable
default
False
property icon Template ITemplate
attribute
inner element
static value
bindable
default
null
property icon Text String
attribute
inner element
static value
bindable
default
null

HTML produced by the control