@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

Property Modifiers Type Description
anchor string The id of the element the tooltip is anchored to
anchorElement HTMLElement | null the html element currently being used as anchor. Setting this directly overrides the anchor attribute.
autoUpdateMode AutoUpdateMode Controls 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.
delay number The delay in milliseconds before a tooltip is shown after a hover event
horizontalViewportLock boolean Controls if the tooltip will always remain fully in the viewport on the horizontal axis
position TooltipPosition Controls 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.
verticalViewportLock boolean Controls if the tooltip will always remain fully in the viewport on the vertical axis
visible boolean Whether the tooltip is visible or not. If undefined tooltip is shown when anchor element is hovered

Methods

Method Modifiers Description
connectedCallback()
disconnectedCallback()