set_auto_layout
Configure a frame's layout: disable auto layout, enable flexible (horizontal/vertical) layout with spacing and wrap, or apply CSS-grid layout with row and column settings.
Instructions
Configure a frame's auto layout. layoutMode NONE disables it; HORIZONTAL/VERTICAL enable flex (padding / itemSpacing / alignment / wrap, plus counterAxisSpacing / counterAxisAlignContent for the wrapped cross axis — the CSS row-gap / align-content — and itemReverseZIndex / strokesIncludedInLayout for paint order and stroke-in-layout); GRID enables CSS-Grid-style layout (padding / gridRowCount / gridColumnCount / gridRowGap / gridColumnGap). Returns { ok, nodeId }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | ||
| gridRowGap | No | ||
| layoutMode | Yes | ||
| layoutWrap | No | ||
| paddingTop | No | ||
| itemSpacing | No | ||
| paddingLeft | No | ||
| gridRowCount | No | ||
| paddingRight | No | ||
| gridColumnGap | No | ||
| paddingBottom | No | ||
| gridColumnCount | No | ||
| itemReverseZIndex | No | Paint later siblings UNDER earlier ones (reversed canvas order) — the stacked-avatars / overlapping-cards pattern, usually with negative itemSpacing. HORIZONTAL/VERTICAL only | |
| counterAxisSpacing | No | Cross-axis gap between wrapped rows (px) — the CSS row-gap when it differs from itemSpacing (gap: 16px 8px). Requires layoutWrap WRAP (settable in the same call) | |
| counterAxisAlignItems | No | ||
| primaryAxisAlignItems | No | ||
| counterAxisAlignContent | No | How wrapped rows distribute along the cross axis: AUTO packs them at counterAxisSpacing, SPACE_BETWEEN spreads them (align-content). Requires layoutWrap WRAP | |
| strokesIncludedInLayout | No | Make strokes take up layout space (gaps/padding grow by the stroke weight); Figma defaults to excluding them. HORIZONTAL/VERTICAL only |