From 6c190c7801c89cf5dde9ad058347e44290641304 Mon Sep 17 00:00:00 2001 From: Ryan Mah Date: Wed, 22 Apr 2026 11:44:14 -0700 Subject: [PATCH] Version 1 Update 125 Co-Authored-By: Claude Opus 4.7 (1M context) --- plugin-api-standalone.d.ts | 26 ++++++++++++++++++++++++++ plugin-api.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/plugin-api-standalone.d.ts b/plugin-api-standalone.d.ts index 25772c8..cbc2dfc 100644 --- a/plugin-api-standalone.d.ts +++ b/plugin-api-standalone.d.ts @@ -1082,6 +1082,32 @@ interface PluginAPI { * ``` */ createFrame(): FrameNode + /** + * Note: This API is only available via `use_figma` in the MCP server + * + * Creates a new frame with auto layout already enabled. Both axes default to hug content + * (`primaryAxisSizingMode = "AUTO"`, `counterAxisSizingMode = "AUTO"`), so children can + * immediately use `layoutSizingHorizontal/Vertical = "FILL"` after being appended. + * + * @remarks + * + * Prefer this over `createFrame()` whenever you need an auto-layout parent. Since `layoutMode` is + * already set, children can use `FILL` sizing immediately after being appended. + * + * The default direction is `"HORIZONTAL"`. Pass `"VERTICAL"` for a column layout. + * + * ```ts title="Create an auto-layout frame" + * const row = figma.createAutoLayout() + * const column = figma.createAutoLayout("VERTICAL") + * + * row.itemSpacing = 16 + * row.paddingTop = 24 + * row.paddingBottom = 24 + * row.paddingLeft = 24 + * row.paddingRight = 24 + * ``` + */ + createAutoLayout(direction?: 'HORIZONTAL' | 'VERTICAL'): FrameNode /** * Note: This API is only available in Figma Design * diff --git a/plugin-api.d.ts b/plugin-api.d.ts index f0c6fc6..d546796 100644 --- a/plugin-api.d.ts +++ b/plugin-api.d.ts @@ -1078,6 +1078,32 @@ interface PluginAPI { * ``` */ createFrame(): FrameNode + /** + * Note: This API is only available via `use_figma` in the MCP server + * + * Creates a new frame with auto layout already enabled. Both axes default to hug content + * (`primaryAxisSizingMode = "AUTO"`, `counterAxisSizingMode = "AUTO"`), so children can + * immediately use `layoutSizingHorizontal/Vertical = "FILL"` after being appended. + * + * @remarks + * + * Prefer this over `createFrame()` whenever you need an auto-layout parent. Since `layoutMode` is + * already set, children can use `FILL` sizing immediately after being appended. + * + * The default direction is `"HORIZONTAL"`. Pass `"VERTICAL"` for a column layout. + * + * ```ts title="Create an auto-layout frame" + * const row = figma.createAutoLayout() + * const column = figma.createAutoLayout("VERTICAL") + * + * row.itemSpacing = 16 + * row.paddingTop = 24 + * row.paddingBottom = 24 + * row.paddingLeft = 24 + * row.paddingRight = 24 + * ``` + */ + createAutoLayout(direction?: 'HORIZONTAL' | 'VERTICAL'): FrameNode /** * Note: This API is only available in Figma Design *