setCanvasGrid
Sets the canvas grid layout, reorganizing nodes in the canvas.
info
This API is only available in Figma Slides and Figma Buzz
Signature
setCanvasGrid(canvasGrid: Array<Array<SceneNode>>): void
Parameters
canvasGrid
A 2D array representing the new canvas grid layout
Remarks
This allows you to programmatically rearrange the layout of slides or assets in the canvas grid. All nodes in the current grid must be included in the new layout.
For example:
const grid = figma.getCanvasGrid()
const [firstRow, ...rest] = grid
// move the first row to the end
figma.setCanvasGrid([...rest, firstRow])