Tooltip
Tooltips are contextual, non-actionable, and informative floating labels. They can be activated by hover to display additional information to help users understand something. They should always be non-essential to the global understanding.
Hover me!
<qtm-tooltip tooltip-title="Tooltip title." content="Write the tooltip content here.">
Hover me!
</qtm-tooltip>
The tooltip can be displayed by adding a visible property.
Default tooltip
<qtm-tooltip
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here."
>
Default tooltip
</qtm-tooltip>
Tooltip Sizes
Tooltips are available in three sizes: small, medium, large. By default, the medium tooltip is used. You can change the tooltip size with the size property.
<qtm-tooltip
size="small"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here."
>
Small tooltip
</qtm-tooltip>
<qtm-tooltip
size="medium"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here."
>
Medium tooltip
</qtm-tooltip>
<qtm-tooltip
size="large"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here."
>
Large tooltip
</qtm-tooltip>
Tooltip Orientations
The tooltip component can be positioned according to its target by setting the orientation property with the bottom, top, left, right values.
Top tooltip
Left tooltip
Right tooltip
Bottom tooltip
<qtm-tooltip
orientation="top"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here.">
Top tooltip
</qtm-tooltip>
<qtm-tooltip
orientation="left"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here.">
Left Tooltip
</qtm-tooltip>
<qtm-tooltip
orientation="right"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here.">
Right tooltip
</qtm-tooltip>
<qtm-tooltip
orientation="bottom"
visible
tooltip-title="Tooltip title."
content="Write the tooltip content here.">
Bottom tooltip
</qtm-tooltip>
Tip Positions
The tooltip component should always be positioned according to its target. The tip position variants help you complete the tooltip orientation variant to be even more precise.
For all orientations, use the tip-position property with the start, center, end values.
<qtm-tooltip tip-position="end" content="Top end tooltip" visible></qtm-tooltip>
<qtm-tooltip tip-position="center" content="Top center tooltip" visible></qtm-tooltip>
<qtm-tooltip tip-position="start" content="Top start tooltip" visible tip-position="start"></qtm-tooltip>
...
Low Contrast Option
To lower the visual emphasis on the tooltip component, you can activate the Low contrast option by adding the lowContrast property. This option will apply a lighter background to the tooltip while remaining always accessible.
Hover me!
<qtm-tooltip
visible
low-contrast
tooltip-title="Tooltip title."
content="Write the tooltip content here"
>
Hover me!
</qtm-tooltip>