Skip to main content

Tooltip

Properties

PropertyTypeDescription
titlestringText displayed in tooltip
arrowbooleanWeather to display arrow, pointing to child
colorstringBackground color of tooltip popup
defaultOpenbooleanWeather the tooltip is opened by default
mouseEnterDelaynumberDelay before tooltip is shown on mouse enter
mouseLeaveDelaynumberDelay before tooltip is hidden on mouse leave
overlayStyletableCSS Properties of tooltip card
overlayInnerStyletableCSS Properties of tooltip inner content
placementstringPlacement of the tooltip popover
triggerhover focus click contextMenuHow the tooltip is triggered to display and hide
openbooleanWeather tooltip is displayed
onOpenChangefunction(open)Fired when tooltip is opened/closed

Ant Design Tooltip Page

Children

Tooltip requires children. Because the tooltip is displayed when a child element is hovered.

Example

myUI:createElement("Tooltip", {
title = "Tooltip",
onOpenChange = function (id, uiName, open)
print("Open: ", open)
end,
}, {
AM:createElement("Text", {text = "Child Text"}),
})

How it looks:

image

title

Title/Text of the tooltip.

arrow

When true an arrow is displayed pointing to child elements. image

Can also be a table arrow = {pointAtCenter = true}:

image

color

Color of the tooltip background. color = "pink":

image

defaultOpen

Weather the tooltip is open by default.

mouseEnterDelay

A delay (in seconds) before the tooltip is displayed when mouse enters the child element.

mouseLeaveDelay

A delay (in seconds) before the tooltip is hidden when mouse leaves the child element.

overlayStyle

CSS Properties for the parent element of the visible tooltip container.

overlayInnerStyle

CSS Properties for the visible tooltip element/container.

placement

Placement of the popover, can be any one of the following: top, left, right, bottom, topLeft, topRight, bottomLeft, bottomRight, leftTop, leftBottom, rightTop, rightBottom.

Example of placement = "topRight":

image

trigger

Can be any one of the following: hover focus click contextMenu.

How the tooltip is triggered to display, so when trigger = "click" the tooltip will display when a child element is clicked.

Is "hover" by default.

open

Controls weather the tooltip is displayed. When set you'll have to handle how the tooltip is displayed yourself.