Documentation Index
Fetch the complete documentation index at: https://mintlify.com/open-pencil/open-pencil/llms.txt
Use this file to discover all available pages before exploring further.
create_shape
Create a shape on the canvas. Use FRAME for containers/cards, RECTANGLE for solid blocks, ELLIPSE for circles, TEXT for labels, SECTION for page sections.Node type. Options:
FRAME, RECTANGLE, ELLIPSE, TEXT, LINE, STAR, POLYGON, SECTIONX position
Y position
Width in pixels (minimum: 1)
Height in pixels (minimum: 1)
Node name shown in layers panel
Parent node ID to nest inside
Returns a summary of the created node (id, name, type).
render
Render JSX to design nodes. Primary creation tool — creates entire component trees in one call.JSX string to render. Example:
<Frame name="Card" w={320} h="hug" flex="col" gap={16} p={24} bg="#FFF" rounded={16}><Text size={18} weight="bold">Title</Text></Frame>X position of the root node
Y position of the root node
Parent node ID to render into
Returns the root node summary with id, name, type, and children IDs.
update_node
Update properties of an existing node: position, size, opacity, corner radius, visibility, text, font.Node ID
X position
Y position
Width (minimum: 1)
Height (minimum: 1)
Opacity (0-1)
Corner radius (minimum: 0)
Visibility
Text content (TEXT nodes)
Font size (minimum: 1)
Font weight (100-900)
Layer name
Returns the node ID and array of updated properties.
delete_node
Delete a node by ID.Node ID to delete
Returns the deleted node ID.
clone_node
Clone (duplicate) a node.Node ID to clone
Returns a summary of the cloned node (id, name, type).
rename_node
Rename a node in the layers panel.Node ID
New name
Returns the node ID and new name.
reparent_node
Move a node into a different parent.Node ID to move
New parent node ID
Returns the node ID and parent ID.
node_move
Move a node to new coordinates.Node ID
X position
Y position
Returns the node ID and new coordinates.
node_resize
Resize a node.Node ID
Width (minimum: 1)
Height (minimum: 1)
Returns the node ID and new dimensions.
node_replace_with
Replace a node with JSX content.Node ID to replace
JSX string for the replacement
Returns the new node summary (id, name, type).
select_nodes
Select one or more nodes by ID.Node IDs to select
Returns the selected node IDs.
group_nodes
Group selected nodes.Node IDs to group (minimum: 2)
Returns the group node summary (id, name, type).
ungroup_node
Ungroup a group node.Group node ID
Returns the ungrouped node ID.
flatten_nodes
Flatten nodes into a single vector.Node IDs to flatten
Returns the flattened node summary (id, name, type).
create_component
Convert a frame/group into a component.Node ID to convert
Returns the component node summary (id, name, type).
create_instance
Create an instance of a component.Component node ID
X position
Y position
Returns the instance node summary (id, name, type).
create_page
Create a new page.Page name
Returns the page ID and name.
switch_page
Switch to a different page by name or ID.Page name or ID
Returns the page name and ID.
create_vector
Create a vector node with optional path data.X position
Y position
Node name
VectorNetwork JSON
Fill color (hex)
Stroke color (hex)
Stroke weight
Parent node ID
Returns the vector node summary (id, name, type).
create_slice
Create a slice (export region) on the canvas.X position
Y position
Width (minimum: 1)
Height (minimum: 1)
Slice name
Parent node ID
Returns the slice node summary (id, name, type).
create_variable
Create a new variable in a collection.Variable name
Variable type. Options:
COLOR, FLOAT, STRING, BOOLEANCollection ID
Initial value (hex for COLOR, number for FLOAT, etc.)
Returns the created variable object.
set_variable
Set the value of a variable for a specific mode.Variable ID
Mode ID
Value (hex for COLOR, number for FLOAT, etc.)
Returns the variable ID, mode, and new value.
delete_variable
Delete a variable.Variable ID
Returns the deleted variable ID.
bind_variable
Bind a variable to a node property (fills, strokes, opacity, width, height, etc.).Node ID
Property field (fills, strokes, opacity, width, height, etc.)
Variable ID
Returns the node ID, field, and variable ID.
create_collection
Create a new variable collection.Collection name
Returns the created collection object.
delete_collection
Delete a variable collection and all its variables.Collection ID
Returns the deleted collection ID.
boolean_union
Union (combine) multiple nodes.Node IDs to union
Returns the resulting boolean node summary (id, name, type).
boolean_subtract
Subtract the second node from the first.Node IDs (first minus rest)
Returns the resulting boolean node summary (id, name, type).
boolean_intersect
Intersect multiple nodes.Node IDs to intersect
Returns the resulting boolean node summary (id, name, type).
boolean_exclude
Exclude (XOR) multiple nodes.Node IDs to exclude
Returns the resulting boolean node summary (id, name, type).
path_set
Set vector path data on a node. Provide a VectorNetwork JSON.Node ID
VectorNetwork JSON
Returns the node ID.
path_scale
Scale vector path from center.Node ID
Scale factor (e.g. 2 for double)
Returns the node ID and scale factor.
path_flip
Flip vector path horizontally or vertically.Node ID
Flip axis. Options:
horizontal, verticalReturns the node ID and flip axis.
path_move
Move all path points by an offset.Node ID
X offset
Y offset
Returns the node ID and offsets.
eval
Execute JavaScript with full Figma Plugin API access. Use for operations not covered by other tools. Thefigma global is available.
JavaScript code to execute
Returns the result of the executed code, or null if no return value.