Complete the code to create a new frame in Figma.
const frame = figma.create[1]();The createFrame() method creates a new frame in Figma.
Complete the code to set the frame's width to 300 pixels.
frame.[1] = 300;
The width property sets the frame's width in pixels.
Fix the error in the code to add the frame to the current page.
figma.currentPage.[1](frame);The appendChild() method adds a node to the current page in Figma.
Fill both blanks to set the frame's fill color to red.
frame.fills = [{ type: '[1]', color: { r: [2], g: 0, b: 0 } }];The SOLID fill type is used for solid colors. The red channel is set to 1 for full red.
Fill all three blanks to create a text node with content 'Hello' and font size 24.
const text = figma.createText();
await figma.loadFontAsync({ family: '[1]', style: '[2]' });
text.fontName = { family: '[1]', style: '[2]' };
text.characters = '[3]';
text.fontSize = 24;You must set fontName to the loaded 'Roboto Regular' font before setting characters to 'Hello'.
