Possibility to move main components between files/libraries

My library is getting too large , I’ve tried to cut and paste component from my large library to another file, but it seems to break the links in the files that are using these components. Also the components that are pasted become instances for some reason, so the original component seems to be lost.
Is there a way of de-centralizing my library with breaking everything up?

2 Likes

Figma just released a way to move components between files natively!

Short tutorial:

1 Like

WooHoo thanks will be checking this out. Update, Yep finally we are here - long journey. I just refactored my library quickly. The only pain point left is that overrides can be lost on the new moved component. Depends on how deeply you rely on these - some of my designs are 100% custom auto layout overrides. So it gets quite gnarly with nested components and overrides - you need to read these in depth

Moding components

Override rules

1 Like

I don’t think this is a good implementation. I cannot do anything with this feature.
According to this, I need to CUT components from the existing file in order to move them to another. But I don’t want to destroy my current library.

I want to COPY components and place them in a separate file so I could use them for another project, separately/independently of the original file.

If I do copy components to another file they act as instances there. Why would someone want to have a full page of components laid out as instances? I don’t get it.

The only reason I guess Figma did this (or didn’t do it properly) is they don’t want to store the huge duplicate libraries on their servers. They would force us to use one library for multiple projects, which is definitely not what we want. I cannot modify one component and use it equally in all projects.

I just need to duplicate the library that is it. And if I add some new screens (or I have some existing screens in some files) I want to be able to link them to any library on any page/file.

Is there a way to do it now, or did I miss anything?
(I tried with some plugins including DSO and Master but I cannot achieve the desired result)

1 Like

Don’t duplicate the component, duplicate the whole file. You even said it in your post: “I just need to duplicate the library that is it.” Then remove everything you don’t need from the duplicate file if necessary. If you need to switch other files to use this new library, use the swap library feature. https://help.figma.com/hc/en-us/articles/4404856784663-Swap-style-and-component-libraries

Hey Gleb, thanks!
Well, it seems the duplicate file works now! it preserves elements as components.

Unfortunately, this works only if I have both library and the designs in the same file. If the file doesn’t become too large I can finish the project and just copy everything. In case when my file has a library in another place, then the linking is still an issue.

I still think Figma needs to work on this to streamline the whole process with libraries if they want to stay on top of the game.

But why? I don’t see any reason why that won’t work if they are separate. After duplicating use the Swap Library feature if necessary.

I agree, this all works super weirdly in Figma and feels very raw. But they just added these mechanics so hopefully that would improve in the future.

@Gleb Sorry I didn’t explain it well. It works when copying files. Figma will duplicate the file correctly with all links, rewriting any instances links in the new file to point to components in that new file (if there are any instances there at all). This is very cool, although I’d rather like to see a dialog asking me where do I want to point instances links during/after copying.

Also, the issue we discussed was when I try to merge content or just link content (instances) to different files/libraries. DSO helps up to some point, it relinked some pages well, but only if the library was inside the file. Component Relinker did it by (I guess) caching the external library, but it crashes on large libraries, and relinking sometimes stops in the middle of the process. I tried the Swap option as well. For this, I need to have both libraries published, and it’s buggy, there are always missing library issues for some styles or icons. But I’ll dig into it more, thanks. Also, if I want to add bulk components to my library, every time I paste components to that file they become instances. Again, it would be nice to see a dialog: copy components or create instances. Otherwise, I don’t see a way to enrich libraries unless I CUT from the old library, but I don’t want to cut, I want to keep them where they were as well.

I tried your Master as well, (thanks for contributing!) it also helps with some things, but not with this particular problem.

Anyway, I managed to solve my issue, most of the things are now sorted out, my libraries are updated and properly linked, although the process was definitely not straightforward.

I guess due to Figma limitations it is not possible to link across files with plugins, is that correct?

Ah, ok, that makes sense. Yes, there is no perfect solution and swap library can be buggy at times. Glad you solved the issue though!

I think the main issue with it is that it only works with one component at a time and you need to relink multiple components. Is my assumption correct? Because other than that its versatility allows you to use it on any combination of local/published components.

Yep.

Thanks! @Gleb

I think the main issue with it is that it only works with one component at a time and you need to relink multiple components. Is my assumption correct?

Yes. But I will still keep it, it’s a useful plugin, good job.

Hello, I’m having some issues with the published components feature.
In my team we need to move an icon set out of a UI kit to create an isolated library for icons. When we cut and paste each icon in the new file, the components using those icons don’t recognize the new link and the action restore component appears on the right panel of the screen.
Any advice for this please.
Thanks in advance