TooltipMixin

A mixin providing common tooltip functionality.

Inheritors

Properties

Link copied to clipboard
abstract var ariaLinkMode: String

Controls which ARIA attribute is used to link the target element(s) with the tooltip content. Supported values:

Link copied to clipboard
abstract var ariaTarget: JsAny

Element used to link with the ARIA attribute controlled by the ariaLinkMode property. Supports array of multiple elements. When not set, defaults to target.

Link copied to clipboard
abstract var context: JsAny

Object with properties passed to generator and shouldShow functions for generating tooltip text or detecting whether to show the tooltip or not.

Link copied to clipboard
abstract var focusDelay: Double

The delay in milliseconds before the tooltip is opened on keyboard focus, when not in manual mode.

Link copied to clipboard
abstract var for: String

The id of the element to be used as target value. The element should be in the DOM by the time when the attribute is set, otherwise a warning is shown.

Link copied to clipboard
abstract var generator: JsAny

Function used to generate the tooltip content. When provided, it overrides the text property. Use the context property to provide argument that can be passed to the generator function.

Link copied to clipboard
abstract var hideDelay: Double

The delay in milliseconds before the tooltip is closed on losing hover, when not in manual mode. On blur, the tooltip is closed immediately.

Link copied to clipboard
abstract var hoverDelay: Double

The delay in milliseconds before the tooltip is opened on hover, when not in manual mode.

Link copied to clipboard
abstract var manual: Boolean

When true, the tooltip is controlled programmatically instead of reacting to focus and mouse events.

Link copied to clipboard
abstract var markdown: Boolean

When enabled, the tooltip text is rendered as Markdown.

Link copied to clipboard
abstract var opened: Boolean

When true, the tooltip is opened. In manual mode, this can be set programmatically. In automatic mode, this is set automatically by internal logic.

Link copied to clipboard
abstract var position: String

Position of the overlay with respect to the target. Supported values: top-start, top, top-end, bottom-start, bottom, bottom-end, start-top, start, start-bottom, end-top, end, end-bottom.

Link copied to clipboard
abstract var shouldShow: JsAny

Function used to detect whether to show the tooltip based on a condition, called every time the tooltip is about to be shown on hover and focus. The function takes two parameters: target and context, which contain values of the corresponding tooltip properties at the time of calling. The tooltip is only shown when the function invocation returns true.

Link copied to clipboard
abstract var target: JsAny

Reference to the DOM element used both to trigger the overlay by user interaction and to visually position it on the screen.

Link copied to clipboard
abstract var text: String

String used as a tooltip content.

Functions

Link copied to clipboard
abstract fun setDefaultFocusDelay(focusDelay: Double)

Sets the default focus delay to be used by all tooltip instances, except for those that have focus delay configured using property.

Link copied to clipboard
abstract fun setDefaultHideDelay(hideDelay: Double)

Sets the default hide delay to be used by all tooltip instances, except for those that have hide delay configured using property.

Link copied to clipboard
abstract fun setDefaultHoverDelay(hoverDelay: Double)

Sets the default hover delay to be used by all tooltip instances, except for those that have hover delay configured using property.