blockly > Block > data
Block.data property
Optional text data that round-trips between blocks and XML. Has no effect. May be used by 3rd parties for meta information.
Signature:
data: string | null;
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.
[null,null,["Last updated 2024-09-18 UTC."],[[["`data` is an optional property on Blockly blocks used to store arbitrary text data."],["This data is preserved when blocks are converted to and from XML, allowing for persistence."],["`data` has no inherent functionality within Blockly itself and is primarily intended for use by external tools or extensions."],["It can be used to store metadata, custom configurations, or any other information relevant to a specific block."]]],["The `Block.data` property is an optional string or null value associated with a block. It allows for storing text data that persists during XML serialization and deserialization. This property has no internal effect within the system, and it serves as a metadata container for external use by third-party developers. It enables additional information to be associated with blocks without impacting the core functionality.\n"]]