Complete the code to add auto layout to a frame in Figma.
frame.[1]({ direction: 'VERTICAL' })
In Figma plugin API, addAutoLayout is the correct method to add auto layout to a frame.
Complete the code to set the spacing between items in an auto layout frame.
frame.layoutMode = 'HORIZONTAL'; frame.[1] = 16;
The property itemSpacing sets the space between items in an auto layout frame in Figma.
Fix the error in setting the auto layout direction property.
frame.layoutMode = [1];The layoutMode property requires a string value in uppercase, so it must be in quotes like 'VERTICAL'.
Fill both blanks to create a frame with auto layout and set padding.
const frame = figma.createFrame(); frame.[1]({ direction: 'HORIZONTAL' }); frame.[2] = 24;
Use addAutoLayout to add auto layout and paddingLeft to set left padding on the frame.
Fill all three blanks to create a vertical auto layout frame with spacing and padding.
const frame = figma.createFrame(); frame.[1]({ direction: 'VERTICAL' }); frame.[2] = 12; frame.[3] = 20;
First, add auto layout with addAutoLayout. Then set spacing with itemSpacing and top padding with paddingTop.