Complete the code to create a new frame in Figma.
const frame = figma.create[1]();In Figma, to create a new frame, you use figma.createFrame().
Complete the code to add a rectangle to the frame.
const rect = figma.createRectangle();
frame.[1](rect);To add a child node to a frame in Figma, use appendChild().
Fix the error in the code to set the rectangle's fill color to red.
rect.fills = [{ type: 'SOLID', color: [1] }];Figma uses color values between 0 and 1, so red is { r: 1, g: 0, b: 0 }.
Fill both blanks to create a multi-step flow with two frames and navigate between them.
const frame1 = figma.create[1](); const frame2 = figma.create[2]();
Multi-step flows use frames as screens, so both blanks should be 'Frame'.
Fill all three blanks to set up navigation between frames using prototype connections.
figma.currentPage.selection = [frame1]; figma.viewport.scrollAndZoomIntoView([frame1]); frame1.[1] = [{ [2]: frame2.id, [3]: 'ON_CLICK' }];
To create a prototype connection, use prototypeNodes with destinationId and trigger.
