Hi everyone, in this video we are going to completely swap a library... that a design file is linked to... it's a great way to try out new designs because this one is hideous... and instead of making it better let's swap out the library... and there we go, new library, swapped... so if you need more Brush Script or Comic Sans in your life continue watching...
or if you just want to figure out how to swap libraries... you have to keep watching too, let's get in there... okay, let me set the scene, tell the story. I have got this file here called Event App... it's using a bunch of components, and colors, and font styles... not in this document...
we moved it to this Main Styles and Components document, great... but now I want to go and try out different styles... so I want to swap the library, I'm not going to do it to this app... this one's too complex, there's things going on... I just want to build a version 2 of my styles... and see what they look like on all the components...
before we go and commit them to all the documents that it's connected to... it's a really good use case for swapping libraries. So here's my original, Main Styles and Components, I have made a version 2... just with a few of the elements, the Top Nav, the Lower Nav... I've updated the button and some of the text, vive la Brush Script... so what I'm going to do is, instead of just going to this file...
'Option 3', 'Alt 3' on a PC... and going and-- I can go into here... because it's connected to Main Styles, I could go into here and say... 'Swap Library', and update everything... what I'm going to do, so things don't go crazy... I've created this file here called Design Change Test, just a simple document...
it's still connected to Main Styles... I've thrown in a few of the components, and colors, and type... that I want to experiment with, and I'm going to change this one... just to keep it away from that working dock... so let's close that down, we're not using anymore. This original one is connected to this document...
let's switch it out to this new version where I've changed colors and fonts... just as, like a little test run, you get me? All right, let's give it a whirl... so for this to work you need both styles to be published... they both need to be in a Team Library if you want to use comp components... you need to be on a paid plan, at least for the components part...
surprise, jump cut, I've added two colored boxes... using my primary and secondary colors... just to help with the example... I want to swap this file's library, so 'Option 3', 'Alt 3' on a PC... so what I want to go to is, I want to find this, go to the little arrow here... and there's an option in the bottom that says 'Swap Library'...
and it's going to go from my Main Styles that I created first... to this new one here called Main Styles V2... it defaulted to that, because I chose it before, when I first recorded this video... and got lost, and restarted and re-recorded, anyway. So you'll have to pick yours from there... now the big trick here is to make sure...
that the styles in both the first one and the second one have the same name... can you see, H3, from my Text Style, is called H3 over here... my colors have the same folder structure, let's have a look... Color-Primary 500, same with this one here... Color-Primary, I got lazy, I only needed two colors... but as long as the names match up it'll work...
you'll notice in this V2, I don't have my accent color, again, because I'm lazy... and I'm going to pretend it's because-- look at this... anything that can't be found or matched will still retain the old style... this might just be a heads up for you to go... and actually make that color in the new style, I'm going to ignore it... down here the Upper Nav, it's called the Upper Nav, the two different styles...
the one thing here is it's missing this Primary button... let's actually do this now and then I'll go through and see why this one's broken... let's go to 'Swap Libraries'... 3, 2, 1, and swatch, cool, huh. So it goes through, it has updated the Top Nav, the Lower Nav... the colors, the font, hasn't done the button...
so let's go and connect those up... so it's a good way just to kind of be working on this kind of a... maybe an update version of your files without pushing it live to the team... because it's a big move... once you've done a few tests you might want to then go through... and get people to switch, the files that they're working on to the new style...
it might just be subtle changes, nothing big and Brush Script-ey, like this one... let's go figure out why this didn't connect. So in here, it's called Button Main... so that's what that main component is... let's double check it, go to 'Main Component'... it is called Button Main, what have I called it in Main Styles here?
I've called it Button-Main, so I need to go through and say, there you go... I need to publish this again, everything needs to be published... 'Option 3', 'Alt 3' - it's the last time I'm going to say it, I promise. - to open up the Libraries panel, let's publish it... now we can go over here and say, 'Update Library'... let's go to here, let's swap the library for this library here...
the only thing that's found is this one here, so we can go and swap... here we go, Comic Sans goodness. That is a big old library swap... if you just want to do an individual swap... oh, a shortcut, that maybe I haven't shared... 'Command Shift T', 'Ctrl Shift T' on a PC, opens up the last closed tab...
it's a shortcut I use all the time for both browser and on Figma... so you can go in here and say... actually, I don't want to do that whole library swap thing... I just want to go through and switch out just one little bit... I'm going to go to this, it's an instance of Upper Nav... I can go over to here, some components were moved since I last did this...
what were they? Yeah, why not, ignore that... I'm going to go, you, let's not switch the whole library... let's just switch this instance... so we can go over here, and up here where it says Nav Upper, click on this... I'm going to 'Swap Instance'...
it's connected to that other file here, my Main Style... I actually want to connect the library for my version 2... so I'm just going to activate it there... and do nothing, not going to swap it, I'm just going to go in here, turn it on... so that I can say, you can be swapped, 'Instance Swap', with that one there... and let's swap it with this top thing, cool, huh.
it's moved it across, preserved the color change that I have on this Top Nav... there was an override to it, so I can right click it and say, 'Reset All Changes'... so you can do bits individually, or you can swap out the whole library... just got to make sure you're using... the exact same names as your current library with your new library... there you go, that is swapping libraries in Figma.