Skip to main content



This API is only available in Figma Design

Creates a new, empty component.


createComponent(): ComponentNode


By default, the new node has width and height both at 100, and is parented under figma.currentPage.

This function creates a brand new component. To turn an existing frame into a component, simply create a component and move the layers over to the new component:

Create a component
const component = figma.createComponent()
component.resizeWithoutConstraints(frame.width, frame.height)
for (const child of frame.children) {
// Note: also copy over other properties of the frame
// such as clipsContent, backgrounds, layoutGrids, etc if desired.

On this page