set_auto_layout
Add, change, or remove auto layout on Figma frames, components, and instances by setting gap, padding, sizing, wrap, and alignment; only provided options are updated.
Instructions
Add, change or remove auto layout on frames / components / instances. Only the options you pass are changed. gap: number, or 'AUTO' for space-between. padding: number | [vertical, horizontal] | [top,right,bottom,left] | {top,right,bottom,left}. primarySizing/counterSizing: HUG (auto) or FIXED. wrap (HORIZONTAL only) + counterGap = spacing between wrapped rows. mode NONE removes auto layout. Returns per-node results ({id, ok, ...} or {id, error}); one failing node does not abort the batch.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"nodeIds": "<nodeIds>"
},
"name": "set_auto_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap | No | Item spacing, or 'AUTO' = space between | |
| file | No | Target file (fileKey, id or name). Defaults to the most recently active file. | |
| mode | No | ||
| wrap | No | Wrap children onto new rows (HORIZONTAL only) | |
| nodeIds | Yes | Figma node ids, e.g. ['12:34'] | |
| padding | No | number | [v,h] | [top,right,bottom,left] | {top,right,bottom,left} (object form sets only given sides) | |
| counterGap | No | Spacing between wrapped rows (requires wrap) | |
| clipsContent | No | ||
| counterAlign | No | Alignment across the layout direction (BASELINE: horizontal only) | |
| primaryAlign | No | Alignment along the layout direction | |
| counterSizing | No | Size across the layout direction | |
| primarySizing | No | Size along the layout direction | |
| strokesIncludedInLayout | No |