Complete the code to create a component from a selected frame in Figma.
const component = figma.createComponent();
component.name = [1];We use the name of the selected frame to name the new component.
Complete the code to detach an instance from its main component.
const detachedNode = instance.[1]();The correct method to detach an instance is detachInstance().
Fix the error in the code to create a component set from selected variants.
const componentSet = figma.[1](variants);The correct method to create a component set is createComponentSet().
Fill both blanks to correctly set the main component and add it to the page.
const mainComponent = figma.[1](); figma.currentPage.[2](mainComponent);
Use createComponent() to create the component and appendChild() to add it to the page.
Fill all three blanks to create a component, set its name, and move it to the current page.
const comp = figma.[1](); comp.[2] = 'Button'; figma.currentPage.[3](comp);
First, create the component with createComponent(). Then set its name. Finally, add it to the page with appendChild().