Selection
Read and set the current Figma selection.
Type reference
// Selection is the set of nodes currently highlighted in the Figma canvas.// get returns the current selection. Without depth, returns stubs ({id, name, type}). With depth=0, returns full properties.// _truncated: true when the response was cut short due to node budget limits. Use depth=0 or specific fields to reduce payload.// set replaces the entire selection AND scrolls the viewport to show the selected nodes.2 methods available.
Get the current selection
| Parameter | Type | Required | Description |
|---|---|---|---|
depth | number | ✗ | Child recursion depth. Omit for stubs only, 0=selected nodes' properties, -1=unlimited. |
verbose | boolean | ✗ | Include all properties (bounding box, constraints, text style details). Default false — returns slim, actionable output. |
Response
| Field | Type | Description |
|---|---|---|
results | object[] | |
↳ id | string | |
↳ name | string | |
↳ type | string | |
_truncated | boolean | |
_notice | string |
Example response
{ "results": [ { "id": "1:2", "name": "Button", "type": "COMPONENT" } ]}Set selection to nodes and scroll viewport to show them
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeIds | string[] | ✓ | Array of node IDs to select. Example: ["1:2","1:3"] |
Response
| Field | Type | Description |
|---|---|---|
count | number | Number of nodes selected |
selectedNodes | object[] | |
↳ name | string | |
↳ id | string | |
notFoundIds | string[] | IDs that could not be found |
Example response
{ "count": 2, "selectedNodes": [ { "name": "Button", "id": "1:2" }, { "name": "Card", "id": "3:4" } ]}