I’d like to be able to take a non-component and swap it out for a component. I know you can already swap instances of a component with an instance of another component, but you can’t take something that isn’t already a component (or an instance) and swap it out with an existing component.
This plugin is really handy for that if the component is in the same file you are trying to swap with! Unfortunately, it doesn’t work with libraries at the moment.
Another ‘hacky’ workaround is:
Make non-component a component > duplicate > delete main component > now you should be able to swap the temporary component in your right-sidebar.
Hope this helps!
That is hacky! But it would do the trick. I’ll try the plugin, as at this point all of the components are currently in the file.
For external components or if you want to preserve all overrides when attaching objects to component (texts, images, etc.) you can use my plugin Master.
- Select the component you want to link objects to. Go to Plugins → Master → Pick Target Component.
- Select objects you want to attach and run the command Plugins → Master → Link Objects to Target Component. These objects will be linked to the component that you picked and all possible overrides will be preserved if the structures of attached objects are the same as the main component.
To swap with local and external component I use this plugin :
How to use Team Library Component Browser "For external library :
Open this plugin in library what you want to list.
Go to Setting tab in this plugin.
Click ‘Save or update this library data’ button to save all components data in library to this plugin.
Go back to your document and open this plugin.
Find components by searching or scrolling, then double-click or click “Create” button to insert instance into the document.
Because of the specifications of Figma’s API, we can’t get team library data automatically.
So this plugin uses the figma.clientStorage API to store the library data on your machine.
To store library data in clientStorage, you need to run this plugin in your library.