Skip to main content

gridItemsPositioning

Applicable only on auto-layout frames with layoutMode set to "GRID". Controls how children are positioned within the grid.

Signature

gridItemsPositioning: 'MANUAL' | 'ROW_AUTO_FLOW'

Remarks

  • "MANUAL" (default): children stay at the grid cell they are placed in. Use setGridChildPosition or appendChildAt to position children explicitly.
  • "ROW_AUTO_FLOW": children are placed by layer order into the next available cell in row-major order (left to right, top to bottom), similar to CSS grid-auto-flow: row. Calling setGridChildPosition will throw an error in this mode — reorder children using insertChild instead.
Grid with automatic item positioning
const grid = figma.createFrame()
grid.layoutMode = 'GRID'
grid.gridColumnCount = 2
grid.gridAutoTracks = 'ROWS'
grid.gridItemsPositioning = 'ROW_AUTO_FLOW'

const a = figma.createFrame()
const b = figma.createFrame()
const c = figma.createFrame()
grid.appendChild(a)
grid.appendChild(b)
grid.appendChild(c)

// Children flow automatically:
// + --- + --- +
// | a | b |
// + --- + --- +
// | c | |
// + --- + --- +