blockly > Block > compose
Block.compose property
An optional method that reconfigures the block based on the contents of the mutator dialog.
Signature:
compose?: (rootBlock: Block) => void;
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.
[null,null,["Last updated 2025-05-16 UTC."],[[["`compose` is an optional function on blocks that can be used to reconfigure the block's appearance and behavior."],["This function is triggered when changes are made within the block's mutator dialog, allowing dynamic updates based on user interactions."],["The `compose` function receives the parent block as an argument, providing context and access to related components for modification."]]],["The `Block.compose` property is an optional function within the Blockly library. Its purpose is to modify a block's configuration after a mutator dialog's contents have been changed. This function takes a `Block` as a parameter and executes to reconfigure the block based on the updates from the dialog. It uses the updated information in order to compose the block.\n"]]