create_instance
Create a linked copy of a component master and append it to a parent frame or the page root. Use to reuse design system components in layouts.
Instructions
Create an instance of an existing component. Mutates the canvas — appends a new InstanceNode as the last child of parent (or the active page root if omitted). The instance is LINKED to the component master, so future component edits propagate. Returns the new instance's nodeId.
Use when:
Spawning runtime copies of a Component master (buttons, list items, cards)
Reusing a design-system component in a fresh layout
Programmatic instantiation outside a jsx() tree-build
Returns: { data: { id: "5:42", name: "Button", componentId: "1:2" } }
Parameters beyond schema:
nodemust be a Component node (not Frame, Text, or another Instance). Discover IDs with find_nodes({ type: "COMPONENT" }).parentoptional. If parent is auto-layout, the instance enters the flow and inherits sizing rules. If omitted, the instance is placed at the active page root with detached position — may overlap existing content; set explicit position with edit afterwards.
Skip when:
Duplicating a non-component node — instance creation will fail; use clone_node instead.
Building a subtree from scratch — use jsx with for atomic single-call construction.
Examples: create_instance({node: "1:2"}) // at page root create_instance({node: "1:2", parent: "1:4"}) // inside frame 1:4
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | Yes | Component node ID (e.g. "1:2") to instantiate | |
| parent | No | Parent node ID for placement |