create_component
Convert an existing node into a reusable component or create an empty one to build into. Specify parent, size, and position to organize the canvas for reuse.
Instructions
Create a reusable main component. Pass fromNodeId to convert an existing node into a component (e.g. a frame of vectors from import_svg, or a built layout) — it keeps the node's position and parent unless parentId is given; omit fromNodeId to create an empty component to build into. Then create_instance the result to reuse it. Optionally sized / named / positioned and placed under a parent (default: current page). Returns { ok, nodeId, name, type }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| name | No | ||
| width | No | ||
| height | No | ||
| parentId | No | Parent node id (default: current page) | |
| fromNodeId | No | Convert this existing node into a component (default: create an empty component) |