Stay organized with collections
Save and categorize content based on your preferences.
blockly > FlyoutButton
Class for a button or label in the flyout.
Signature:
export declare class FlyoutButton implements IBoundedElement, IRenderedElement, IFocusableNode
Implements: IBoundedElement, IRenderedElement, IFocusableNode
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the FlyoutButton
class.
Properties
Property |
Modifiers |
Type |
Description |
BORDER_RADIUS |
static |
number |
The radius of the flyout button's borders. |
cursorSvg |
|
SVGElement | null |
Holds the cursors svg element when the cursor is attached to the button. This is null if there is no cursor on the button. |
height |
|
number |
The height of the button's rect. |
info |
|
toolbox.ButtonOrLabelInfo |
|
TEXT_MARGIN_X |
static |
number |
The horizontal margin around the text in the button. |
TEXT_MARGIN_Y |
static |
number |
The vertical margin around the text in the button. |
width |
|
number |
The width of the button's rect. |
Methods
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 2025-05-16 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 2025-05-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eFlyoutButton\u003c/code\u003e class represents buttons or labels within Blockly's flyout, providing functionality for their creation, positioning, and interaction.\u003c/p\u003e\n"],["\u003cp\u003eThis class is primarily for internal use within Blockly and should not be extended or directly instantiated by third-party code.\u003c/p\u003e\n"],["\u003cp\u003eFlyout buttons can display text, have customizable dimensions and margins, and are associated with a target workspace.\u003c/p\u003e\n"],["\u003cp\u003eSeveral properties like \u003ccode\u003eheight\u003c/code\u003e, \u003ccode\u003ewidth\u003c/code\u003e, \u003ccode\u003einfo\u003c/code\u003e, and methods like \u003ccode\u003ecreateDom()\u003c/code\u003e, \u003ccode\u003edispose()\u003c/code\u003e, \u003ccode\u003emoveTo()\u003c/code\u003e are available for managing button appearance and behavior.\u003c/p\u003e\n"],["\u003cp\u003eWhile implementing \u003ccode\u003eIASTNodeLocationSvg\u003c/code\u003e, the \u003ccode\u003esetMarkerSvg()\u003c/code\u003e method is not utilized for FlyoutButtons and instead triggers an associated callback function when marked.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [FlyoutButton](./blockly.flyoutbutton_class.md)\n\nFlyoutButton class\n------------------\n\nClass for a button or label in the flyout.\n\n**Signature:** \n\n export declare class FlyoutButton implements IBoundedElement, IRenderedElement, IFocusableNode \n\n**Implements:** [IBoundedElement](./blockly.iboundedelement_interface.md), [IRenderedElement](./blockly.irenderedelement_interface.md), [IFocusableNode](./blockly.ifocusablenode_interface.md)\n\nRemarks\n-------\n\nThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `FlyoutButton` class.\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-------------------------------------------------------------------------|-----------|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [BORDER_RADIUS](./blockly.flyoutbutton_class.border_radius_property.md) | `static` | number | The radius of the flyout button's borders. |\n| [cursorSvg](./blockly.flyoutbutton_class.cursorsvg_property.md) | | SVGElement \\| null | Holds the cursors svg element when the cursor is attached to the button. This is null if there is no cursor on the button. |\n| [height](./blockly.flyoutbutton_class.height_property.md) | | number | The height of the button's rect. |\n| [info](./blockly.flyoutbutton_class.info_property.md) | | [toolbox.ButtonOrLabelInfo](./blockly.utils_namespace.toolbox_namespace.buttonorlabelinfo_typealias.md) | |\n| [TEXT_MARGIN_X](./blockly.flyoutbutton_class.text_margin_x_property.md) | `static` | number | The horizontal margin around the text in the button. |\n| [TEXT_MARGIN_Y](./blockly.flyoutbutton_class.text_margin_y_property.md) | `static` | number | The vertical margin around the text in the button. |\n| [width](./blockly.flyoutbutton_class.width_property.md) | | number | The width of the button's rect. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|-----------------------------------------------------------------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------|\n| [canBeFocused()](./blockly.flyoutbutton_class.canbefocused_1_method.md) | | See IFocusableNode.canBeFocused. |\n| [createDom()](./blockly.flyoutbutton_class.createdom_1_method.md) | | |\n| [dispose()](./blockly.flyoutbutton_class.dispose_1_method.md) | | Dispose of this button. |\n| [getBoundingRectangle()](./blockly.flyoutbutton_class.getboundingrectangle_1_method.md) | | Returns the coordinates of a bounded element describing the dimensions of the element. Coordinate system: workspace coordinates. |\n| [getButtonText()](./blockly.flyoutbutton_class.getbuttontext_1_method.md) | | |\n| [getFocusableElement()](./blockly.flyoutbutton_class.getfocusableelement_1_method.md) | | See IFocusableNode.getFocusableElement. |\n| [getFocusableTree()](./blockly.flyoutbutton_class.getfocusabletree_1_method.md) | | See IFocusableNode.getFocusableTree. |\n| [getSvgRoot()](./blockly.flyoutbutton_class.getsvgroot_1_method.md) | | |\n| [getTargetWorkspace()](./blockly.flyoutbutton_class.gettargetworkspace_1_method.md) | | Get the button's target workspace. |\n| [getWorkspace()](./blockly.flyoutbutton_class.getworkspace_1_method.md) | | Get the button's workspace. |\n| [isLabel()](./blockly.flyoutbutton_class.islabel_1_method.md) | | |\n| [moveBy(dx, dy, _reason)](./blockly.flyoutbutton_class.moveby_1_method.md) | | Move the element by a relative offset. |\n| [moveTo(x, y)](./blockly.flyoutbutton_class.moveto_1_method.md) | | Move the button to the given x, y coordinates. |\n| [onNodeBlur()](./blockly.flyoutbutton_class.onnodeblur_1_method.md) | | See IFocusableNode.onNodeBlur. |\n| [onNodeFocus()](./blockly.flyoutbutton_class.onnodefocus_1_method.md) | | See IFocusableNode.onNodeFocus. |\n| [setCursorSvg(cursorSvg)](./blockly.flyoutbutton_class.setcursorsvg_1_method.md) | | Add the cursor SVG to this buttons's SVG group. |\n| [show()](./blockly.flyoutbutton_class.show_1_method.md) | | Correctly position the flyout button and make it visible. |"]]