Stay organized with collections
Save and categorize content based on your preferences.
blockly > clipboard > paste
clipboard.paste() function
Paste a pasteable element into the given workspace.
This function does not perform any checks to ensure the paste is allowed, e.g. that the workspace is rendered or the block is pasteable. Such checks should be done before calling this function.
Signature:
export declare function paste<T extends ICopyData>(copyData: T, workspace: WorkspaceSvg, coordinate?: Coordinate): ICopyable<T> | null;
Parameters
Parameter |
Type |
Description |
copyData |
T |
The data to paste into the workspace. |
workspace |
WorkspaceSvg |
The workspace to paste the data into. |
coordinate |
Coordinate |
(Optional) The location to paste the thing at. |
Returns:
ICopyable<T> | null
The pasted thing if the paste was successful, null otherwise.
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-07-24 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-07-24 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eclipboard.paste()\u003c/code\u003e function inserts copied data, represented by \u003ccode\u003ecopyData\u003c/code\u003e, into a specified Blockly workspace.\u003c/p\u003e\n"],["\u003cp\u003eThis function takes the data to paste, the target workspace, and an optional coordinate for placement as arguments.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful pasting, it returns the pasted element; otherwise, it returns null.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [clipboard](./blockly.clipboard_namespace.md) \\\u003e [paste](./blockly.clipboard_namespace.paste_1_function.md)\n\nclipboard.paste() function\n--------------------------\n\nPaste a pasteable element into the given workspace.\n\nThis function does not perform any checks to ensure the paste is allowed, e.g. that the workspace is rendered or the block is pasteable. Such checks should be done before calling this function.\n\n**Signature:** \n\n export declare function paste\u003cT extends ICopyData\u003e(copyData: T, workspace: WorkspaceSvg, coordinate?: Coordinate): ICopyable\u003cT\u003e | null;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|------------|-------------------------------------------------------------|--------------------------------------------------|\n| copyData | T | The data to paste into the workspace. |\n| workspace | [WorkspaceSvg](./blockly.workspacesvg_class.md) | The workspace to paste the data into. |\n| coordinate | [Coordinate](./blockly.utils_namespace.coordinate_class.md) | *(Optional)* The location to paste the thing at. |\n\n**Returns:**\n\n[ICopyable](./blockly.icopyable_interface.md)\\\u003cT\\\u003e \\| null\n\nThe pasted thing if the paste was successful, null otherwise."]]