Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions plugin-api-standalone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
26 changes: 26 additions & 0 deletions plugin-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Loading