penpot_reorder_shapes
Reorder a shape's stacking position among its siblings. Supports moving to front, back, forward, backward, or before/after a target shape.
Instructions
Change a shape's stacking (z-)order among its siblings, matching Penpot's own "Bring to front" / "Send to back" / "Forward" / "Backward" UI actions. Shapes have no explicit z-index — order is implicit in their parent's child list, where later entries render on top. "front"/"back" move the shape to the top/bottom of the stack; "forward"/"backward" swap it with the next/previous sibling (a no-op if already at that end); "before"/"after" place it immediately before/after another sibling given as targetId. Only reorders among existing siblings — does not reparent (use penpot_update_shapes's parentId/frameId for that).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| fileId | Yes | ||
| pageId | Yes | ||
| shapeId | Yes | ||
| targetId | No |