Skip to main content
harsha20599
New Participant
Feb 17, 2021 10:33 AM UTC

Replace a layer with component

We recently migrated into Figma and imported all our sketch files. I created a solid DS in Figma. Now the problem is, while working on old files, It’s hard to remove a layer and place the component at the same place.

It’s been so much annoying and it’s a life saving feature to have something like replace layer with component.

Do you also faced same problem ? Please help me out if you have a workaround or plugin that eases this.

21 replies

Gleb
Power Member
Oct 7, 2021 6:08 AM UTC

Maddy, this is the best way to do it as of now if you don’t care about keeping overrides.

moenen
Nov 30, 2021 8:57 PM UTC

Unfortunately Master doesn’t work when you try to replace an object with a component from an external library.

Gleb
Power Member
Nov 30, 2021 11:09 PM UTC

It should. Select a component published to the library, run Master → Pick Target Component. Then select objects you want to replace and run Master → Link Objects to Target Component.

If something isn’t working, send me an example here or to gleb@dominate.design so I can investigate what could be wrong. A video recording of your actions and links to files would be perfect.

Alex_Fedorov
Jan 6, 2022 3:21 PM UTC

I love Figma but goddam if they couldn’t just include a Replace… or Replace With… in the right-click menu like Sketch.

Sarah19
Jan 28, 2022 5:37 PM UTC

Our team is planning a transition to Figma, and I’m coming across this issue over and over as I rebuild our pattern library. Replace with... is one of the primary features I use for curating and building components in Sketch, so this is a huge friction point for me.

Figma—please tell me this feature is in the works. 🙏

Brad_Ruesch
Feb 5, 2022 7:11 PM UTC

@Sarah19 Check out Figma’s “Paste to Replace” functionality. I think this will help. Here’s a link to the Copy and Paste Playground Figma Community file:

Figma

Play with the examples to get the hang of it.

Sarah19
Feb 8, 2022 7:28 PM UTC

Thanks! I did discover this tool and it is helping.

Fang_Gao
Feb 15, 2022 6:11 PM UTC

The paste to replace doesn’t work if it’s a group / frame to be replaced right. It only works with image I guess. Is there a way that I can replace a group in a component? Thanks!

Fabian
New Member
Feb 16, 2022 11:04 AM UTC

I just released a plugin, where you can select a frame and replace it with a component and keep the original text from the frame. Only requirement: The original frame and the component must have the same amount of text-frames:

Figma

This Plugin also helps of you want to reattach a detached instance of a component.

Miki_UX
New Member
Feb 28, 2023 10:19 AM UTC

Hey Harsha, same problem: needed to replace a hundred components. Lucky thing is that they all have the same name. What I did is:

  1. Searched for that layer name, results showed
  2. I copied the component that will replace them (make sure it has a different name than the ones to be replaced)
  3. And then I just pressed cmd + shift + R until all the components in the results were replaced.

Manual, but worked for me in a matter of seconds. Hope this helps, thanks.