Skip to main content
Question

Duplicate master component


Eric10

Is there a way to duplicate a component as a master (not instance) while maintaining it’s properties? I can create an instance, detach it, then make it a component again but the properties are lost when detaching.

This topic has been closed for comments

13 replies

tank666
  • 4863 replies
  • July 25, 2022

Copy the master component and paste it into another file, then cut and paste into the first file.


Eric10
  • Author
  • 25 replies
  • July 25, 2022

When I copy/paste, it doesn’t paste as a master, it pastes as an instance.


tank666
  • 4863 replies
  • July 25, 2022

Did you copy the master component and paste it into another file?


Eric10
  • Author
  • 25 replies
  • July 25, 2022

Yes. When I do that, it’s just an instance. Do you get different results? If I do a variant set, that actually does, but not a single master component.


tank666
  • 4863 replies
  • July 25, 2022

In order not to suffer, select the desired object on the canvas, open the console and apply the following code:

figma.currentPage.selection[0].clone()

Eric10
  • Author
  • 25 replies
  • July 26, 2022

It worked. Thanks


Lea_Delazer1

It’s so cool to use the console for things like that! Apart from the main dev documentation is there some resoource that collects useful snippets like this one? I tried a few times to invest more time into learning the code behind Figma but get swept away by the many design tasks I have.

Don’t wanna be lazy though, I’m just curious if someone was already so kind to share a few of those…


tank666
  • 4863 replies
  • July 26, 2022

Unfortunately, I can’t suggest any resources other than official developer documentation and various GitHub/GitLab solutions.

You can also search for scripts for the Scripter plugin.
For example:

Figma

Lea_Delazer1

Thanks! I know the scripter plugin, that’s what actually made me curious in getting into direct automation. But actually, I think it’s best to simply learn the language to really start using it, there’s usually no real shortcut.

But at least I’m now interested in taking another look into the Developer docs 😅


Lea_Delazer1

@Eric10 I just noticed that CMD+D or Strg+D “Duplicate” actually creates a clone even of master components. I was not aware but that’s now probably the easiest way to achieve your goal 😀


Eric10
  • Author
  • 25 replies
  • July 26, 2022

Duplicating doesn’t seem to work for me. Copy/past, Option + drag, all do the same - create an instance. Unless I’m missing something. Here’s a screen recording. https://www.loom.com/share/b0a9818fa4884ca0b6e4ce43ed61d6ca


Lea_Delazer1

You’re right, it only works with component sets that contain variants. I think consistent behaviour would be nice but it’s probably just because duplicating a component set cannot produce a single object like it is the case for a component.

So I take back my claim of having the fastest solution available and hand it back to the console command then 😅


  • 0 replies
  • August 24, 2022

This topic was automatically closed after 30 days. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings