Stay organized with collections
Save and categorize content based on your preferences.
blockly > FieldLabel > (constructor)
FieldLabel.(constructor)
Constructs a new instance of the FieldLabel
class
Signature:
constructor(value?: string | typeof Field.SKIP_SETUP, textClass?: string, config?: FieldLabelConfig);
Parameters
Parameter |
Type |
Description |
value |
string | typeof Field.SKIP_SETUP |
(Optional) The initial value of the field. Should cast to a string. Defaults to an empty string if null or undefined. Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by subclasses that want to handle configuration and setting the field value after their own constructors have run). |
textClass |
string |
(Optional) Optional CSS class for the field's text. |
config |
FieldLabelConfig |
(Optional) A map of options used to configure the field. See the [field creation documentation]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/label#creation for a list of properties this parameter supports. |
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."],[[["`FieldLabel` is used to create non-interactive text labels within Blockly blocks."],["The constructor initializes a `FieldLabel` with an optional value, CSS class for text styling, and configuration options."],["`Field.SKIP_SETUP` can be passed as the value to delay field setup for subclasses."]]],["The `FieldLabel` class constructor creates a new field instance. It accepts three optional parameters: `value`, a string representing the initial field value or `Field.SKIP_SETUP` to defer setup; `textClass`, a string for the field's CSS class; and `config`, a `FieldLabelConfig` object for field customization, detailed in the field creation documentation. The default value for `value` is an empty string if not provided.\n"]]