Skip to main content
🏠ComponentsTooltipVersion: 2.0.0-beta.5

Tooltip

Tooltips are contextual, non-actionable, and informative floating labels. They can be activated by hover, focus, or even click to display additional information to help users understand something. They should always be non-essential to the global understanding.

Hover me!

<QtmTooltip tooltipTitle="Tooltip title." content="Write the tooltip content here.">
Hover me!
</QtmTooltip>

The tooltip can be displayed by adding a visible property.

Default tooltip

<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
>
Default tooltip
</QtmTooltip>

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.

Small tooltipMedium tooltipLarge tooltip
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
size="small"
>
Small tooltip
</QtmTooltip>
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
size="medium"
>
Medium tooltip
</QtmTooltip>
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
size="large"
>
Large tooltip
</QtmTooltip>

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

<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
orientation="top"
>Top tooltip</QtmTooltip
>
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
orientation="left"
>Left tooltip</QtmTooltip
>
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
orientation="right"
>Right tooltip</QtmTooltip
>
<QtmTooltip
visible
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
orientation="bottom"
>Bottom tooltip</QtmTooltip
>

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 tipPosition property with the start, center, end values.

<QtmTooltip content="Top end tooltip" visible tipPosition="end"></QtmTooltip>
<QtmTooltip content="Top center tooltip" visible></QtmTooltip>
<QtmTooltip
content="Top start tooltip"
visible
tipPosition="start"
></QtmTooltip>
<QtmTooltip
content="Left end tooltip"
visible
tipPosition="end"
orientation="left"
></QtmTooltip>
...

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!

<QtmTooltip
visible
lowContrast
tooltipTitle="Tooltip title."
content="Write the tooltip content here."
>
Hover me!
</QtmTooltip>

API

QtmTooltip

PropertyTypeDefaultDescription
classesstring''List of classes to override or extend the styles applied to the component. You can use available utility classes by importing
contentstring''The tooltip content.
lowContrastbooleanfalseLow contrast option to apply a lighter background.
orientation"bottom" | "left" | "right" | "top"'top'Tooltip position according to its target.
size"large" | "medium" | "small"'medium'The size of element
tipPosition"center" | "end" | "start"'center'The tip position.
titlestring''DEPRECATED: The deprecated tooltip title. Use `tooltipTitle` instead.
tooltipTitlestring''The tooltip title.
visiblebooleanfalseVisible option of the tooltip to display.

Deprecated Property

Note: The title property is deprecated. Use the tooltipTitle property instead.