penpot_create_component
Register a shape tree as a reusable Penpot component. Assign explicit IDs to shapes for nesting; the unparented shape becomes the component root. Returns a component ID for placing instances.
Instructions
Register a new shape tree as a Penpot component (its "main instance"). Accepts the same shape specs as penpot_add_shapes (rect/frame/text, with layout/rotation/etc.); give each shape an explicit "id" so children can nest under a sibling via matching "parentId"/"frameId". The one shape not parented to a sibling in this call becomes the component root. Returns the componentId, usable with penpot_add_component_instance to place copies elsewhere.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileId | Yes | ||
| pageId | Yes | ||
| shapes | Yes | ||
| tokensPath | No | /app/tokens.json | |
| componentName | Yes |