Skip to main content

Tooltip

<ui5-tooltip> | Since 2.29.0

The ui5-tooltip shows a short, non-interactive text near an element to provide supplementary information. The element it describes points at the tooltip with data-ui5-has-tooltip="<id>" (to drive the gestures) and aria-describedby="<id>" (for the accessible description). The tooltip text is the component's text content.

It opens on hover, keyboard focus and long-press, and closes on Escape, activation or when the pointer/focus leaves.

Usage​

<button data-ui5-has-tooltip="t1" aria-describedby="t1">Save</button>
<ui5-tooltip id="t1">Save the document</ui5-tooltip>

ES6 Module Import​

import "@ui5/webcomponents/dist/Tooltip.js";

Properties​

horizontalAlign​

DescriptionDefines the horizontal alignment of the tooltip relative to its opener.
Type"Center" | "End" | "Start" | "Stretch" (value descriptions in: PopoverHorizontalAlign)
Default"Center"

placement​

DescriptionDefines the placement of the tooltip relative to its opener.
Type"Bottom" | "End" | "Start" | "Top" (value descriptions in: PopoverPlacement)
Default"Top"

preventOnTouch​

DescriptionPrevents the tooltip from opening on touch devices (the long-press gesture).
Set this for openers whose native touch behavior must win — for example a link, where the long-press context menu is more important than the tooltip.
Typeboolean
Defaultfalse

Slots​

No slots available for this component.

Events​

No events available for this component.

Methods​

closeTooltip​

DescriptionCloses the tooltip.
Return typevoid

isOpen​

DescriptionWhether the tooltip is currently open.
Return typeboolean

openTooltip​

DescriptionOpens the tooltip against its opener.
Return typevoid

CSS Parts​

No CSS parts available for this component.

CSS Custom States​

No CSS custom states available for this component.