Stay organized with collections
Save and categorize content based on your preferences.
blockly > Tooltip
Functions
Variables
Variable |
Description |
HOVER_MS |
Delay before tooltip appears. |
LIMIT |
Maximum width (in characters) of a tooltip. |
MARGINS |
Horizontal padding between tooltip and screen edge. |
OFFSET_X |
Horizontal offset between mouse cursor and tooltip. |
OFFSET_Y |
Vertical offset between mouse cursor and tooltip. |
RADIUS_OK |
Radius mouse can move before killing tooltip. |
Type Aliases
Type Alias |
Description |
CustomTooltip |
A function that renders custom tooltip UI. 1st parameter: the div element to render content into. 2nd parameter: the element being moused over (i.e., the element for which the tooltip should be shown). |
TipInfo |
A type which can define a tooltip. Either a string, an object containing a tooltip property, or a function which returns either a string, or another arbitrarily nested function which eventually unwinds to a string. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe Tooltip namespace provides functions and variables for managing tooltips in Blockly, including showing, hiding, and customizing their appearance and behavior.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to bind and unbind mouse events, control tooltip visibility, and set custom tooltip content.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can define custom tooltips using a provided type alias and function, enabling flexible and tailored tooltip experiences.\u003c/p\u003e\n"],["\u003cp\u003eSeveral variables control tooltip behavior such as delay, maximum width, and offsets, allowing for customization of tooltip positioning and appearance.\u003c/p\u003e\n"],["\u003cp\u003eThe namespace includes type aliases for defining custom tooltips and tooltip information, further enhancing the flexibility of the tooltip system.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Tooltip](./blockly.tooltip_namespace.md)\n\nTooltip namespace\n-----------------\n\nFunctions\n---------\n\n| Function | Description |\n|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [bindMouseEvents(element)](./blockly.tooltip_namespace.bindmouseevents_1_function.md) | Binds the required mouse events onto an SVG element. |\n| [createDom()](./blockly.tooltip_namespace.createdom_1_function.md) | Create the tooltip div and inject it onto the page. |\n| [getCustomTooltip()](./blockly.tooltip_namespace.getcustomtooltip_1_function.md) | Gets the custom tooltip function. |\n| [getDiv()](./blockly.tooltip_namespace.getdiv_1_function.md) | Returns the HTML tooltip container. |\n| [getTooltipOfObject(object)](./blockly.tooltip_namespace.gettooltipofobject_1_function.md) | Returns the tooltip text for the given element. |\n| [hide()](./blockly.tooltip_namespace.hide_1_function.md) | Hide the tooltip. |\n| [isVisible()](./blockly.tooltip_namespace.isvisible_1_function.md) | Returns whether or not a tooltip is showing |\n| [setCustomTooltip(customFn)](./blockly.tooltip_namespace.setcustomtooltip_1_function.md) | Sets a custom function that will be called if present instead of the default tooltip UI. |\n| [unbindMouseEvents(element)](./blockly.tooltip_namespace.unbindmouseevents_1_function.md) | Unbinds tooltip mouse events from the SVG element. |\n\nVariables\n---------\n\n| Variable | Description |\n|----------------------------------------------------------------|-----------------------------------------------------|\n| [HOVER_MS](./blockly.tooltip_namespace.hover_ms_variable.md) | Delay before tooltip appears. |\n| [LIMIT](./blockly.tooltip_namespace.limit_variable.md) | Maximum width (in characters) of a tooltip. |\n| [MARGINS](./blockly.tooltip_namespace.margins_variable.md) | Horizontal padding between tooltip and screen edge. |\n| [OFFSET_X](./blockly.tooltip_namespace.offset_x_variable.md) | Horizontal offset between mouse cursor and tooltip. |\n| [OFFSET_Y](./blockly.tooltip_namespace.offset_y_variable.md) | Vertical offset between mouse cursor and tooltip. |\n| [RADIUS_OK](./blockly.tooltip_namespace.radius_ok_variable.md) | Radius mouse can move before killing tooltip. |\n\nType Aliases\n------------\n\n| Type Alias | Description |\n|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CustomTooltip](./blockly.tooltip_namespace.customtooltip_typealias.md) | A function that renders custom tooltip UI. 1st parameter: the div element to render content into. 2nd parameter: the element being moused over (i.e., the element for which the tooltip should be shown). |\n| [TipInfo](./blockly.tooltip_namespace.tipinfo_typealias.md) | A type which can define a tooltip. Either a string, an object containing a tooltip property, or a function which returns either a string, or another arbitrarily nested function which eventually unwinds to a string. |"]]