figma-mcp-go
v0.8.0Figma MCP server with full read/write access via plugin bridge — no API token or rate limits.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
apply_style_to_node
Apply a local style to a node.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Target node ID |
styleId * | string | Style ID from get_styles |
target | string | Paint styles: fill (default) or stroke |
batch_execute_pipeline
Run write steps in order. A step can use earlier results through $variables. With stop_on_error, a failure undoes created nodes and changed properties, but not deletes, group/ungroup, detach, reparent, or steps that target nodes by name.
| Parameter | Type | Description |
|---|---|---|
steps * | array | Steps in order: {id, action, params, export_vars?} |
stop_on_error | boolean | Stop and undo on error (default true) |
batch_rename_nodes
Rename nodes: set `name`, or find/replace (regex allowed), or prefix/suffix. `name` cannot mix with the others.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
find | string | Text or regex to find in names |
name | string | New name for all nodes. A slash makes a group, e.g. 'Icons/Arrow'. |
prefix | string | Add to start of name |
regexFlags | string | Regex flags (default 'g') |
replace | string | Replacement. find requires it. |
suffix | string | Add to end of name |
useRegex | boolean | find is a regex (default false) |
boolean_operation
Combine 2+ shapes (same parent): UNION, SUBTRACT (cut the rest from the first), INTERSECT, or EXCLUDE. Pipeline rollback cannot undo it.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Shape IDs. Order matters for SUBTRACT. |
operation * | string | Operation |
name | string | Result name |
clone_node
Copy a node, optionally to a new position or parent.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Source node ID |
parentId | string | Parent (default: same as source) |
x | number | X of the copy |
y | number | Y of the copy |
combine_as_variants
Combine 2+ components (same parent) into a variant set. Add VARIANT properties with manage_component_properties.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | COMPONENT node IDs |
name | string | Set name |
create_component
Turn a FRAME into a COMPONENT, in place.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | FRAME node ID to convert |
name | string | Component name (default: frame name) |
create_component_instance
Create an instance of a local (componentId) or library (componentKey) component. A component set uses its default variant.
| Parameter | Type | Description |
|---|---|---|
componentId | string | Local component or set ID (preferred) |
componentKey | string | Library component or set key |
parentId | string | Parent ID (default: current page) |
x | number | X (default: center of view) |
y | number | Y |
create_connector
Create a connector line. This tool operates only in a FigJam file.
| Parameter | Type | Description |
|---|---|---|
endNodeId | string | End node ID |
endPosition | object | End {x, y} |
lineType | string | STRAIGHT or ELBOW |
startNodeId | string | Start node ID |
startPosition | object | Start {x, y} |
create_node
Create a shape. Args per `type`: FRAME: width, height, fillColor, auto layout args. RECTANGLE: width, height, fillColor, cornerRadius. ELLIPSE: width, height, fillColor, startAngle, endAngle, innerRadiusRatio. STAR: pointCount, outerRadius, innerRadius, fillColor, cornerRadius. POLYGON: pointCount, radius, fillColor, cornerRadius. LINE: length, rotation, strokeColor, strokeWeight. SECTION: width, height (no parent). All: x, y, name. The tool rejects other args. For text, use create_text.
| Parameter | Type | Description |
|---|---|---|
type * | string | FRAME, RECTANGLE, ELLIPSE, STAR, POLYGON, LINE, or SECTION |
clipsContent | boolean | Clip content |
cornerRadius | number | Corner radius |
counterAxisAlignItems | string | Cross axis align: MIN, CENTER, MAX, BASELINE |
counterAxisSizingMode | string | Cross axis size: FIXED or AUTO (hug) |
counterAxisSpacing | number | Gap between wrapped rows (with WRAP) |
endAngle | number | Arc end, radians (default full circle) |
fillColor | string | Fill hex e.g. #FF5733 |
height | number | Height (default 100) |
innerRadius | number | STAR inner radius (default 0.38 × outer) |
innerRadiusRatio | number | Hole size 0-1, for rings (default 0) |
itemReverseZIndex | boolean | Put first child on top |
itemSpacing | number | Gap between children |
layoutAlign | string | This node's cross axis align in the parent's auto layout |
layoutGrow | number | 1 = grow to fill the parent's main axis, 0 = keep size |
layoutMode | string | Auto layout: HORIZONTAL, VERTICAL, or NONE |
layoutPositioning | string | In the parent's auto layout: AUTO (in flow) or ABSOLUTE (free, at x/y) |
layoutSizingHorizontal | string | Width mode: FIXED, HUG (fit content), or FILL (fill parent). Prefer this over *AxisSizingMode. HUG needs auto layout on this node. FILL needs auto layout on its parent. |
layoutSizingVertical | string | Height mode: FIXED, HUG, or FILL. The rules are the same as for layoutSizingHorizontal. |
layoutWrap | string | NO_WRAP or WRAP |
length | number | LINE length (default 100) |
maxHeight | number | Max height. null removes it. |
maxWidth | number | Max width. null removes it. |
minHeight | number | Min height. null removes it. |
minWidth | number | Min width. null removes it. |
name | string | Layer name |
outerRadius | number | STAR outer radius (default 50) |
paddingBottom | number | Bottom padding |
paddingLeft | number | Left padding |
paddingRight | number | Right padding |
paddingTop | number | Top padding |
parentId | string | Parent node ID (default: current page) |
pointCount | number | STAR points (default 5) or POLYGON sides (default 3) |
primaryAxisAlignItems | string | Main axis align: MIN, CENTER, MAX, SPACE_BETWEEN |
primaryAxisSizingMode | string | Main axis size: FIXED or AUTO (hug) |
radius | number | POLYGON radius (default 50) |
rotation | number | LINE rotation in degrees |
startAngle | number | Arc start, radians (default 0) |
strokeColor | string | LINE color hex |
strokeWeight | number | LINE width (default 1) |
strokesIncludedInLayout | boolean | Include strokes in layout size |
width | number | Width (default 100) |
x | number | X (default 0) |
y | number | Y (default 0) |
create_style
Create a local style. Args per `type`: PAINT: color. TEXT: fontSize, fontFamily, fontStyle, textDecoration, lineHeightValue/Unit, letterSpacingValue/Unit. EFFECT: effectType, color, opacity, radius, offsetX, offsetY, spread. GRID: pattern, count, gutterSize, offset, alignment, sectionSize, color, opacity. The tool returns the style ID. Apply the style with apply_style_to_node.
| Parameter | Type | Description |
|---|---|---|
name * | string | Style name. A slash makes a group, e.g. 'Brand/Primary'. |
type * | string | PAINT, TEXT, EFFECT, or GRID |
alignment | string | STRETCH (default), CENTER, MIN, MAX |
color | string | Hex. PAINT: required. EFFECT: default #000000. GRID: default #FF0000. |
count | number | Columns/rows count (default 12) |
description | string | Description |
effectType | string | DROP_SHADOW (default), INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR |
fontFamily | string | Default Inter |
fontSize | number | Default 16 |
fontStyle | string | e.g. 'Bold' (default Regular) |
gutterSize | number | Gutter (default 16) |
letterSpacingUnit | string | PIXELS (default) or PERCENT |
letterSpacingValue | number | Letter spacing |
lineHeightUnit | string | PIXELS (default) or PERCENT |
lineHeightValue | number | Line height |
offset | number | Margin (default 0) |
offsetX | number | Default 0 |
offsetY | number | Default 4 |
opacity | number | 0-1. EFFECT default 0.25, GRID default 0.1. |
pattern | string | GRID (default), COLUMNS, ROWS |
radius | number | Blur (default 8 shadow, 4 blur) |
sectionSize | number | Cell size (default 8) |
spread | number | Default 0 |
textDecoration | string | NONE (default), UNDERLINE, STRIKETHROUGH |
create_text
Create a text node (loads the font). To edit text, use set_text.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text |
fillColor | string | Text color hex (default black) |
fontFamily | string | Font family e.g. 'Roboto' (default Inter) |
fontSize | number | Font size (default 14) |
fontStyle | string | Font style e.g. 'Bold' (default Regular). The style must exist for the family. |
name | string | Layer name (default: the text) |
parentId | string | Parent node ID (default: current page) |
x | number | X (default 0) |
y | number | Y (default 0) |
create_vector
Create a vector from SVG markup (e.g. an icon). Several paths become a frame of vectors.
| Parameter | Type | Description |
|---|---|---|
svg * | string | SVG markup |
fillColor | string | Fill color hex |
height | number | Height |
parentId | string | Parent ID (default: current page) |
width | number | Width |
x | number | X (default 0) |
y | number | Y (default 0) |
delete_nodes
Delete nodes. You cannot undo this from here.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs to delete |
delete_style
Delete a style by ID.
| Parameter | Type | Description |
|---|---|---|
styleId * | string | Style ID |
detach_instance
Detach instances into plain frames (same look, no component link).
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | INSTANCE node IDs |
export_frames_to_pdf
Export frames as one PDF, one page per frame, in order.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Frame IDs, in page order |
outputPath * | string | Path of the .pdf file, inside the working directory |
export_screenshots
Export nodes as images. The tool saves items with outputPath to file. It returns the other items (PNG/JPG as image, SVG as text, PDF as base64). Without items, the tool exports the selection. Prefer outputPath if you only need the file.
| Parameter | Type | Description |
|---|---|---|
format | string | Default format: PNG (default), SVG, JPG, PDF |
items | array | {nodeId, outputPath?, format?, scale?}. Omit to export the selection. |
scale | number | Default scale for PNG/JPG (2 for files, 1 when returned) |
export_tokens
Export variables and paint styles as JSON or CSS variables.
| Parameter | Type | Description |
|---|---|---|
format | string | json (default) or css |
find_replace_text
Find and replace text in TEXT nodes, on the current page or inside nodeId.
| Parameter | Type | Description |
|---|---|---|
find * | string | Text or regex to find |
replace * | string | Replacement. "" deletes the text. |
nodeId | string | Search inside this node (default: current page) |
regexFlags | string | Regex flags (default 'g') |
useRegex | boolean | find is a regex (default false) |
flatten_nodes
Merge nodes (same parent) into one vector. Pipeline rollback cannot undo it.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
name | string | Result name |
get_annotations
Get Dev Mode annotations on the page, or on one node and its children.
| Parameter | Type | Description |
|---|---|---|
nodeId | string | Only this node and its children |
get_document
Get the node tree of the selection, page, or file (`scope`). The tool returns {fileName, scope, currentPage, nodes}. The tool stops at 500 nodes by default. It then sets `truncated`, and nodes with hidden children show `childCount`.
| Parameter | Type | Description |
|---|---|---|
dedupe_components | boolean | Show instances in short form (mainComponentId, componentProperties, overrides) and list each component once in `componentDefs`. This saves tokens on screens with many instances. |
depth | number | Levels below each root. 0 = root only. Default 2 for selection, no limit otherwise. |
detail | string | minimal: id/name/type/bounds. compact: + fills/strokes/opacity. full (default): everything. Use lower levels for big files. |
maxNodes | number | Max nodes (default 500). |
scope | string | page (default): current page. document: every page, one shared maxNodes limit. selection: selected nodes, 2 levels deep by default, or the page if the selection is empty. Use selection to explore. |
get_fonts
List fonts used on the current page, most used first.
get_image_bytes
Get the original image files in nodes' image fills, as base64. The tool returns each image once. Nodes without images go in `skipped`. To see how a node looks, use export_screenshots.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs carrying image fills |
get_instance_overrides
Get an instance's component properties with type and value. Use this tool before set_instance_overrides.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | INSTANCE node ID |
get_local_components
Get all components in the file.
get_metadata
Get file name, current page, and all pages (ID, name). The tool loads no node trees.
get_nodes_info
Get full node details by ID. The tool returns {nodes}, plus globalVars.styles for repeated fills/strokes. Unknown IDs go in `missing`. The tool stops at 500 nodes by default. This count includes the requested nodes. It then sets `truncated` and `childCount`.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
depth | number | Levels below each node. 0 = the nodes only. Default no limit. |
maxNodes | number | Max nodes in the result (default 500). |
get_reactions
Get a node's prototype reactions (trigger + actions). Edit them with set_reactions.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID |
get_selection
Get selected nodes, or nodes pinned in the plugin panel. The result is [] if there are none. For detail, use get_nodes_info.
| Parameter | Type | Description |
|---|---|---|
source | string | selection (default): the nodes selected now. It changes when the user clicks. pinned: the set saved in the panel. It stays the same across calls. |
get_styles
Get local styles (paint, text, effect, grid) with ID, name, type, values. For variables, use get_variable_defs.
get_variable_defs
Get local variables (design tokens): collections, modes, values.
get_viewport
Get viewport center, zoom, and visible bounds.
group_nodes
Group 2+ nodes that share a parent.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs (2+) |
name | string | Group name |
import_image
Add an image from a URL (preferred) or base64, as a rectangle sized to the image, or as nodeId's fill.
| Parameter | Type | Description |
|---|---|---|
crop | object | Part of the image to show, {x, y, width, height} each 0-1. This sets scaleMode to CROP. |
filters | object | Adjustments, each -1 to 1 (0 = none) |
height | number | Height (default: image size, max 1000) |
imageData | string | Base64 PNG or JPG, if no URL |
imageUrl | string | Image URL |
mode | string | With nodeId: replace fills (default) or append |
name | string | Node name |
nodeId | string | Fill this node with the image instead of making a rectangle |
parentId | string | Parent node ID (default: current page) |
scaleMode | string | FILL (default), FIT, CROP, or TILE |
width | number | Width (default: image size, max 1000) |
x | number | X (default 0) |
y | number | Y (default 0) |
manage_component_properties
Add, edit, delete, or bind component properties. bind links a layer: BOOLEAN shows/hides it, TEXT sets its text, INSTANCE_SWAP swaps it. Names work without the '#1:2' suffix.
| Parameter | Type | Description |
|---|---|---|
action * | string | add, edit, delete, or bind |
nodeId * | string | COMPONENT or COMPONENT_SET node ID |
defaultValue | Default, for add: boolean, string, or component ID (INSTANCE_SWAP) | |
name | string | Name (add), or new name (edit) |
preferredValues | array | INSTANCE_SWAP: components shown first |
property | string | Property to change, e.g. 'Size' or 'Size#1:2' |
targetNodeId | string | bind: layer inside the component |
type | string | Type, for add. VARIANT needs a COMPONENT_SET. |
manage_page
Add, delete, rename, or go to a page. Args per `action`: add: name, index. delete, navigate: pageId or pageName. rename: pageId or pageName, newName. List pages with get_metadata.
| Parameter | Type | Description |
|---|---|---|
action * | string | add, delete, rename, or navigate |
index | number | Position, 0 = first (default last) |
name | string | New page name (default 'Page') |
newName | string | New name |
pageId | string | Page ID |
pageName | string | Exact page name, instead of pageId |
manage_plugin_data
Store string key/values on a node, saved in the file. Use JSON for complex values.
| Parameter | Type | Description |
|---|---|---|
action * | string | get, set, delete, or keys (list) |
nodeId * | string | Node ID |
key | string | Key (not for keys) |
namespace | string | Default 'figma-mcp-go' |
value | string | Value, for set |
manage_variable
Manage variables (design tokens). Args per `action`: create_collection: name, initialModeName. add_mode: collectionId, modeName. create: name, collectionId, type, value. set_value: variableId, modeId, value. delete: variableId, or collectionId (deletes all its variables). bind: nodeId, variableId, field (node property to link). Get IDs from get_variable_defs. Free plan: 1 mode per collection. If add_mode fails with 'Limited to 1 modes only', do not retry. Put the mode in the name (e.g. 'light/bg') and tell the user multi-mode needs a paid plan.
| Parameter | Type | Description |
|---|---|---|
action * | string | create_collection, add_mode, create, set_value, delete, or bind |
collectionId | string | Collection ID |
field | string | Property to bind. COLOR: fillColor, strokeColor. BOOLEAN: visible. FLOAT: opacity, rotation, width, height, cornerRadius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, strokeWeig… |
initialModeName | string | First mode name (default 'Mode 1') |
modeId | string | Mode ID |
modeName | string | New mode name e.g. 'Dark' |
name | string | Collection or variable name. A slash makes a group, e.g. 'Color/Primary'. |
nodeId | string | bind: the node |
type | string | COLOR, FLOAT, STRING, or BOOLEAN |
value | string | COLOR: hex. FLOAT: number. STRING: text. BOOLEAN: true/false. For create, sets the first mode. |
variableId | string | Variable ID |
outline_stroke
Turn each node's stroke into a filled shape. Nodes without a stroke go in `skipped`.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
reparent_nodes
Move nodes into another frame, group, or section.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs to move |
parentId * | string | New parent ID |
save_version_checkpoint
Save a named version in file history, before big or risky changes. This tool operates only in a Design file.
| Parameter | Type | Description |
|---|---|---|
title * | string | Version name |
description | string | Note |
search_nodes
Find nodes by name, type, or both, on the current page by default. The tool returns up to `limit` nodes (default 50). It sets `truncated` if there are more.
| Parameter | Type | Description |
|---|---|---|
includeHidden | boolean | Search hidden nodes (default true). false skips hidden nodes and their children. |
includeText | boolean | Add characters, fontSize and fontName to TEXT results (default false). |
limit | number | Max results (default 50) |
nodeId | string | Search only inside this node. This overrides scope. |
query | string | Text to find in node names (case-insensitive). Omit to match all nodes of `types`. |
scope | string | page (default) or document (every page). A page search does not look at other pages. |
types | array | Node types e.g. ['TEXT', 'FRAME'] |
set_annotations
Set Dev Mode annotations on nodes ([] clears them). The tool needs a paid Dev Mode seat.
| Parameter | Type | Description |
|---|---|---|
annotations * | array | e.g. [{"label": "Main Button"}]. [] clears them. |
nodeIds * | array | Node IDs |
set_auto_layout
Set auto layout (flexbox) on frames, components or instances: direction, padding, gap, align, sizing (HUG/FILL with layoutSizing*). layoutPositioning, layoutAlign, layoutGrow set how a node sits in its parent. Results are per node.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Frame, component, or instance IDs |
clipsContent | boolean | Clip content |
counterAxisAlignItems | string | Cross axis align: MIN, CENTER, MAX, BASELINE |
counterAxisSizingMode | string | Cross axis size: FIXED or AUTO (hug) |
counterAxisSpacing | number | Gap between wrapped rows (with WRAP) |
itemReverseZIndex | boolean | Put first child on top |
itemSpacing | number | Gap between children |
layoutAlign | string | This node's cross axis align in the parent's auto layout |
layoutGrow | number | 1 = grow to fill the parent's main axis, 0 = keep size |
layoutMode | string | Auto layout: HORIZONTAL, VERTICAL, or NONE |
layoutPositioning | string | In the parent's auto layout: AUTO (in flow) or ABSOLUTE (free, at x/y) |
layoutSizingHorizontal | string | Width mode: FIXED, HUG (fit content), or FILL (fill parent). Prefer this over *AxisSizingMode. HUG needs auto layout on this node. FILL needs auto layout on its parent. |
layoutSizingVertical | string | Height mode: FIXED, HUG, or FILL. The rules are the same as for layoutSizingHorizontal. |
layoutWrap | string | NO_WRAP or WRAP |
maxHeight | number | Max height. null removes it. |
maxWidth | number | Max width. null removes it. |
minHeight | number | Min height. null removes it. |
minWidth | number | Min width. null removes it. |
paddingBottom | number | Bottom padding |
paddingLeft | number | Left padding |
paddingRight | number | Right padding |
paddingTop | number | Top padding |
primaryAxisAlignItems | string | Main axis align: MIN, CENTER, MAX, SPACE_BETWEEN |
primaryAxisSizingMode | string | Main axis size: FIXED or AUTO (hug) |
strokesIncludedInLayout | boolean | Include strokes in layout size |
set_codegen_result
Save code on a node for Dev Mode's Code panel. The whole team sees it. Code on a component shows on its instances. [] removes the code.
| Parameter | Type | Description |
|---|---|---|
blocks * | array | One tab per block |
nodeId * | string | Node ID |
set_effects
Replace a node's effects ([] clears them), in the shape of get_nodes_info's styles.effects.
| Parameter | Type | Description |
|---|---|---|
effects * | array | Effects by `type`. DROP_SHADOW / INNER_SHADOW: color, opacity, offsetX, offsetY, radius, spread, blendMode, and showShadowBehindNode on drop shadows. LAYER_BLUR / BACKGROUND_BLUR: radius. blurType PRO… |
nodeId * | string | Target node ID |
set_export_settings
Set a node's Export presets. This tool does not export. To export, use export_screenshots.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
settings * | array | Presets in order. [] clears them. |
set_instance_overrides
Set an instance's component properties. The tool fails on unknown names or wrong types.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | INSTANCE node ID |
properties * | object | Name to value e.g. {"Size": "Large", "Show Icon": true} |
set_layout_grids
Set layout grids (columns, rows, square) on frames. [] removes them.
| Parameter | Type | Description |
|---|---|---|
grids * | array | Grids. [] removes all. |
nodeIds * | array | Frame, component, or section IDs |
mode | string | replace (default) or append |
set_node_properties
Set node properties: position, size, radius, visibility, lock, opacity, rotation, blend, constraints, z-order, mask, stroke. Pass only what changes. Results are per node.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | Node IDs |
blendMode | string | e.g. NORMAL, MULTIPLY, SCREEN |
bottomLeftRadius | number | Bottom left radius |
bottomRightRadius | number | Bottom right radius |
constraints | object | {horizontal, vertical}: MIN, MAX, CENTER, STRETCH, or SCALE |
cornerRadius | number | Radius for all corners |
dashPattern | array | Dash and gap e.g. [4, 2]. [] = solid. |
height | number | Height |
isMask | boolean | Use as mask for the layers above it |
locked | boolean | Lock or unlock |
maskType | string | ALPHA, VECTOR, or LUMINANCE |
opacity | number | Opacity 0-1 |
order | string | Layer order: bringToFront, sendToBack, bringForward, sendBackward |
rotation | number | Rotation in degrees |
strokeAlign | string | Stroke position |
strokeCap | string | Line ends: NONE, ROUND, SQUARE, ARROW_LINES, ARROW_EQUILATERAL |
strokeJoin | string | Corner style |
strokeMiterLimit | number | Miter limit (default 4) |
strokeWeight | number | Stroke width |
topLeftRadius | number | Top left radius |
topRightRadius | number | Top right radius |
visible | boolean | Show or hide |
width | number | Width |
x | number | Absolute X (not an offset) |
y | number | Absolute Y (not an offset) |
set_paint
Set a node's fill or stroke. SOLID: color, opacity. GRADIENT_*: stops, geometry, opacity.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID |
type * | string | SOLID, GRADIENT_LINEAR, GRADIENT_RADIAL, GRADIENT_ANGULAR, or GRADIENT_DIAMOND |
color | string | SOLID: hex #RRGGBB or #RRGGBBAA |
geometry | GRADIENT: in percentX/percentY. Linear: start, end, angle. Others: center, radius, rotation. | |
mode | string | replace (default) or append on top |
opacity | number | Opacity 0-1 (default 1), multiplied with hex alpha |
stops | GRADIENT: [{position: 0-1, color: hex}] | |
strokeWeight | number | Stroke width (default 1), stroke only |
target | string | fill (default) or stroke |
set_reactions
Set or remove prototype reactions. mode: replace (default) or append. To remove, pass removeIndices (from get_reactions, [] = all), not reactions. Reaction: {"trigger":{"type":...},"actions":[...]}. Triggers: ON_CLICK, ON_HOVER, ON_PRESS, ON_DRAG, AFTER_TIMEOUT (+timeout ms), MOUSE_ENTER, MOUSE_LEAVE, MOUSE_UP, MOUSE_DOWN. Actions: NODE (+destinationId, navigation NAVIGATE|OVERLAY|SCROLL_TO|SWAP|CHANGE_TO, transition, preserveScrollPosition), BACK, CLOSE, URL (+url). Transitions: DISSOLVE, SMART_ANIMATE, or PUSH, MOVE_IN, MOVE_OUT, SLIDE_IN, SLIDE_OUT (these also need direction LEFT|RIGHT|TOP…
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Node ID |
mode | string | replace (default) or append |
reactions | array | Reactions: {trigger, actions} |
removeIndices | array | Indices to remove. [] removes all. Do not use with reactions. |
set_selection
Select and zoom to nodes (switches page if needed) to show the user your work. No IDs clears the selection. Nodes must share a page.
| Parameter | Type | Description |
|---|---|---|
nodeIds | array | Node IDs. An empty list clears the selection. |
select | boolean | Change selection (default true). false + zoom only moves the view. |
zoom | boolean | Zoom to fit (default true) |
set_text
Change a TEXT node's text and whole-node settings (resize, truncation, alignment, spacing). To style parts of the text, use set_text_ranges.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | TEXT node ID |
maxLines | number | Max lines (needs ENDING). null removes it. |
paragraphIndent | number | First line indent |
paragraphSpacing | number | Space between paragraphs |
text | string | New text |
textAlignHorizontal | string | Horizontal align |
textAlignVertical | string | Vertical align |
textAutoResize | string | NONE (fixed), HEIGHT (grow down), WIDTH_AND_HEIGHT (hug), or TRUNCATE |
textTruncation | string | ENDING adds … on overflow |
set_text_ranges
Style parts of a TEXT node (bold, color, link, list). Each range is characters [start, end). Later ranges win on overlap. Omitted properties stay.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | TEXT node ID |
ranges * | array | Ranges to style. Each range needs start and end. |
swap_component
Swap an instance to another component, keeping position and size.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | INSTANCE node ID |
componentId | string | Local component or set ID (preferred) |
componentKey | string | Library component or set key |
ungroup_nodes
Ungroup GROUP nodes. The children move to the parent.
| Parameter | Type | Description |
|---|---|---|
nodeIds * | array | GROUP node IDs |
update_paint_style
Update a paint style's name, color, or description. For other types, delete the style and create it again.
| Parameter | Type | Description |
|---|---|---|
styleId * | string | Paint style ID |
color | string | New color hex |
description | string | New style description |
name | string | New style name |