Skip to main content


Swaps this instance's current main component with componentNode and preserves overrides using the same heuristics as instance swap in the Figma editor UI. Note that we may update these override preservation heuristics from time to time.

Supported on:


swapComponent(componentNode: ComponentNode): void


Learn more about instance swap and override preservation in our help center. If you do not want to preserve overrides when swapping, you should use mainComponent, which sets the instance's main component directly and clears all overrides.

On this page