hi everyone welcome back in this module I'll be sharing components with you and components are a core part of figma and honestly I think they're one of the reasons why figma became so successful we've had components for a long time honestly decades but there are some really cool features of components in figma that make them feel pretty unique so in this module I'll cover what components are how we can create them and how we can use them let's jump in file all right we're here in the file and to give you a quick demo of how and where components can be especially useful I created a button component up here and an instance or a copy of this component has been used in each one of these designs down below now components are all about creating reusable pieces of UI and I thought well a button what a perfect example of something that needs to be reusable and to show you what components can do let's imagine that I'm working on this design and I decide you know what I like for each of the large buttons down here to not be squared or so squared but to instead be completely rounded well up here at the top I can select my main component and again down here we have those instances or copies of the main component now components and instances are directly attached and so what this means is if I navigate to the property panel and let's say I'll adjust our border radius from 8 to 999 and we tap return well now the main component and all of the connected instances down below take on that same aesthetic or those same Properties by using components or working within this model of components and instances we're able to save ourselves so much time as we either create or update or maintain UI across our designs now the first thing to call out before jumping into components is how do we create them and also how can we familiarize ourselves with whether or not we're actually using a component in figma so I have a button here and if I select this button you'll notice its outline or highlight is in blue whenever you select something in figma and you notice that its outline is blue for the selection that means that it's not a connected instance or a component it's not a reusable object in other words but let's say I'd like to use this button in a number of different places and so I'll turn it into a component how to do this is we'll right click on the selected object and towards the bottom there's an option to create a new component or create component the keyboard shortcut which I use all the time is option command K as well and when we tap this look at what happens our button is now highlighted or shown with a purple outline we also notice a new icon here where just to the left of the name name of this now component is a new four Diamond icon whenever or wherever you see a four Diamond icon that means that your selection or the item is a main component it's the original it's where the component Started From Now earlier I mentioned a thing called instances and instances and figma are just copies of main components so to show you what an instance looks like and how it works I'll hold the option key and we'll just create a copy of this main component down below now in the layer list you'll see that this item here is represented with a single Diamond icon that shows or tells me it's an instance in figma if we're ever unsure about our selection and whether it's a main component or an instance or even where the original component comes from well whenever you have an item selected and you navigate to the top right in this case we have our button instance selected and if we navigate to the top right we see a label here called button and this shows or represents the instance's name in this case of course button now just to the right of that there's action here and this takes us to the main component if I select this this will take us to where that main component is whether it's in the same file or another file entirely and if I click this well it's no surprise but it just bumps us up here to the top now the relationship between components and instances is I think pretty interesting where well I'll just give you a demo if I click on this button up here which is the main component or the original component anything I change about this main component will be reflected down below so as an example I'll scroll down here and why don't we adjust this to be not so much a squared button but instead a round button and so I'll adjust my corner radius here to 999 and tap return now down below you can see that that change has been reflected on the instance but what's interesting is if I'm using this instance here in a design I probably don't want it to read label and so I can double click on the label here while holding command and I'll change this to something that feels a little bit better for perhaps the design I'm working on in this case contact us now what we just did is important because it's considered an override to a component or to an instance an override is essentially a change that we make and we can make overrides in the form of text or fills or Strokes or even adding new effects like Drop Shadows when we make an override it means that that override that we made will no longer or can no longer be well overridden by the main component that was a lot of words there and probably a little confusing here's what this means if we were to click on this label here and perhaps change our starting label to maybe not label but default you'll see the override down here the contact us text doesn't change that's because that's a preserved override now to show you this more one thing I didn't change on this was I didn't add a stroke to this and so if I were to go back up to my main button here or my main component and if I add a new stroke let's say oh let's say it's maybe a lighter stroke something like this here and we'll make it a little larger how about three pixels or so well you can see that that stroke has been added on the main component and also on the instances this is the tool or the mechanism that allows our components and our instances to stay completely in sync with one another but we have to be careful because if we were to go on this instance here and let's say we accidentally or maybe intentionally just remove the stroke well this button is still connected to the main component but if you're working within a design system you'll notice that well this might not follow the Design Systems Aesthetics or the buttons Aesthetics that appear elsewhere within the company so we just need to be a little cautious when it comes to overrides because on so many teams the production code will often match that of the main component now one easy thing that we can do is we can always reset an instance rather than deleting it and starting over if we just like to go back to the original and we can do so by navigating in the properties panel and up towards the top where we see that instance name you'll see a more actions menu on the right and if we tap this there's a number of different options in here including go to main component uh create a new component out of the instance which is something you can do in figma or we can even choose to reset this component and in this case as I hover over this action here you can see we can either reset all changes or in this example we can just reset the stroke so I'll tap this and our stroke comes back because that override that we made to the stroke property is no longer there now you may have noticed we did adjust that label there but when I go to the menu here we don't see a reset label or a reset text property appear well that's because the overrides and the actions of resetting them are a bit nested meaning we can click on layers within such as this text layer here and now if I navigate back to the reset menu we should see that ability to reset the text if I tap this we should see default appear within our instance now one thing that can be really useful for those working in the design system space Bas is actually seeing an instance inside of the design and making changes to the main component based on that so as an example perhaps I'm in charge of creating this component for others to use and I noticed in the example or in the situation for where this button appears I might decide you know what I don't know if round is necessarily the right call for this treatment so with the instance here on the right hand side I can go back and I can say why don't I remove that 999 and perhaps add back an 8 pixel corner radius value instead now if I zoom out here you'll notice that only that instance where we applied that corner radius update was now if I zoom out here you'll notice that only the instance where we adjusted the corner radius just now received that update and that makes sense because we didn't apply that new Corner radius value to the main component we only applied it to an instance so what do we do here do we go to all of these instances and make the change or do we go to this component up here and and revert back our Corner radius you know we could do this but one thing that's going to be interesting is well we did make an override here right and if you recall overrides are always preserved and so this means if I were to go up here and let's say I changed this to not be8 but instead zero if we zoom out you'll notice these all these other instances are all now zero but because we made an override over here we're still stuck with eight and this can be a bit complex in figma and so one thing I'd recommend is is to use the feature called push overrides 2 main component and this feature will exist if the main component is in the same file as the instance so what we can do here is rather than making our changes on the main component we can navigate to the right hand side and in the actions menu we can choose the option push changes to main component when we choose this option that new Corner radius value is applied at the main component and also it's applied in the other places where that instance appears honestly this can be really helpful technique or way just to see what does the instance look like where it's actually going to be used and if again the main component is in the same file well this can be a really helpful workflow so we talked about a lot there and we're getting more and more into components and as a reminder we have main components which are the original component and we have instances which are essentially just a copy of the main component any change that we make on the main component will be pushed over to the instance but any change that we make on the instance called an override will always be preserved there's so much more that we can do with components and I'm excited to share with you in the next module but know that components are essentially the building block of many component libraries which are a part of many Design Systems here in figma there's so much more that we can do with components and even more ways that we can build them and architect them so that they're even more flexible for everyone using them we'll talk much more about that in the next module and as always if you have any questions about what we chatted through just now please feel free to reach out and love to make sure that this is all making sense thanks for being here in this one and as always I'm looking forward to seeing you in the next one