Install ↓ Buy $ Docs ?

Bulk swap all instances in the file to a different component

Want to swap instances in Bulk? Master plugin can help swap all instances of a component to a different main component. Simply pick the new component and link the old instances to it. Using the “Pick and Link” actions on components is very similar to using “Find and Replace” for text.

Pick, Link, Repeat

Let’s say you have two components: Component A and Component B. You want to change all instances of Component A to be instances of Component B in bulk. Doing so by hand would take time so let’s automate this process using Master plugin.

  1. Select either the new component you want to swap instances to (Component B) or one of its instances. Use the Master → Pick Target Component.
  2. Select one of the instances you want to swap or the component itself (Component A) and use Master → Link Objects to Target Component. If you select a component and Master says “No objects that can be attached found”, this is normal, Master will still save this component.
  3. Deselect everything (press Esc) and run Master → Link Objects to Target Component again. This will find all instances of the component you just Linked (Component A) in the current file and link them in bulk to the component you Picked (Component B).
  4. If you want to continue replacing instances of Component A in other files, repeat step 3 in each file where you want to swap them.

If both components have the same layer order and hierarchy, the overrides will be preserved. It’s best to make some adjustments to layer structure if they are different in order to not lose overrides in instances.

How does this work? When running the Link command with nothing selected, Master automatically finds all instances of the component that was Linked previously and attaches them. This is a versatile way to batch swap instances which can be used in a variety of contexts.

Bulk swap variant set instances

Single variant components inside of the variant set are just plain regular main components internally in Figma. You can swap a single variant component with another variant component or any other regular component. You can attach any objects to a single variant component.

Alternatively you can swap between the entire variant sets. Swapping instances for variant sets works the same as with regular components. However, variant sets you are swapping between need to have identical property names and values, otherwise it’s not possible to pair them.

To swap between component sets, Pick the target variant set, select a set you want to replace and Link it. All instances of the variant set will be found and attached to the target set. After Linking the set in one file, you can go through other files and link it there. Deselect everything and run the Link command again to find and replace all the instances of the set in the file.

Note that it’s not possible to swap between a single component and a variant set: for such cases you need to select a single variant component in the set. A single variant in the set is the same as a regular main component.

Ignore file pages

Plugin searching a large file for instances to swap may take a while but you can make it ignore certain pages. Prefix names of the pages to skip with _ (example: “_Page 1”): Master will not link components on them.

Additonally, if you add [M] before the page name of the currently active page, Master will only search the active page.

Usage scenarios

Merge two or more components: When you have similar components you may want to consolidate them into one. Simply swap all instances of these components to a single one using Master plugin to merge them.

Move components: Compared to Figma’s native way of moving components, doing it with Master plugin gives you absolute control and safety. Easily undo the move in case you make a mistake and make sure it goes smooth in every file.

Duplicate components: Similar to moving components, you can essentially split the component into two, leaving part of instances in some files attached to the old one and attaching certain files to a new component.

Deprecate components: Easily replace deprecated instances with the new component. With Master you can do it either one instance at a time or to all the instances in the file.

See also

Safely move components between files.

Use component creation feature to clone a component.


Made by Gleb Sabirzyanov.
Got questions or ideas? Let's chat: gleb@dominate.design


Install ↓ Buy $ Docs ?