Skip to main content
Version: 1.x

@microsoft/fast-foundation > Tooltip

Tooltip class

An Tooltip Custom HTML Element.

  • The default slot for the tooltip content

tooltip - The tooltip element

dismiss - Fires a custom 'dismiss' event when the tooltip is visible and escape key is pressed

Signature:
export declare class Tooltip extends FoundationElement 

Properties

PropertyModifiersTypeDescription
anchorstringThe id of the element the tooltip is anchored to
anchorElementHTMLElement | nullthe html element currently being used as anchor. Setting this directly overrides the anchor attribute.
autoUpdateModeAutoUpdateModeControls when the tooltip updates its position, default is 'anchor' which only updates when the anchor is resized. 'auto' will update on scroll/resize events. Corresponds to anchored-region auto-update-mode.
delaynumberThe delay in milliseconds before a tooltip is shown after a hover event
horizontalViewportLockbooleanControls if the tooltip will always remain fully in the viewport on the horizontal axis
positionTooltipPositionControls the placement of the tooltip relative to the anchor. When the position is undefined the tooltip is placed above or below the anchor based on available space.
verticalViewportLockbooleanControls if the tooltip will always remain fully in the viewport on the vertical axis
visiblebooleanWhether the tooltip is visible or not. If undefined tooltip is shown when anchor element is hovered

Methods

MethodModifiersDescription
connectedCallback()
disconnectedCallback()