Complete the code to create a new frame in Figma.
const frame = figma.create[1]();In Figma, createFrame() is used to create a new frame, which is the foundation for organizing design elements.
Complete the code to set the frame's layout mode to vertical.
frame.layoutMode = '[1]';
Setting layoutMode to VERTICAL arranges child elements stacked top to bottom inside the frame.
Fix the error in the code to add a child rectangle to the frame.
const rect = figma.createRectangle();
frame.[1](rect);The correct method to add a child node to a frame in Figma plugin API is appendChild().
Fill both blanks to set the frame's padding and spacing between items.
frame.padding[1] = 16; frame.item[2] = 8;
Use paddingTop to set the top padding and itemSpacing to set space between child items in a frame.
Fill all three blanks to create a frame, set its layout, and add a text child.
const frame = figma.create[1](); frame.layoutMode = '[2]'; const text = figma.create[3](); frame.appendChild(text);
This code creates a frame, sets its layout to VERTICAL, creates a text node, and adds it as a child to the frame.