Here we are! Components is the most important feature you need to master while using Figma.
Components allows us to reason about a smaller part of a greater system and enables us to reuse existing parts saving us time on otherwise repetitive and tedious work.
Creating components in your design file makes the composition of complex designs
- more consistent
- more efficient (by a LOT)
How it works
You can create components from any layers or objects you've designed. These could be a whole range of things like buttons, icons, layouts, and more.
There are two aspects to a Component:
- A Main Component (❖) defines the properties of the Component.
- An Instance (⃟) is a copy of the Component you can reuse in your designs. Instances are linked to the main Component and receive any updates made to the Component.
You can create components to use within a single file. Or, you can use Team Library to share components and Styles across files and projects.
Creating a component
- Select the layers you’d like to be included in the component.
- You then have a few different methods for create a component:
- Click Create component in the toolbar.
- Right-click on your selection and choose Create component.
- Use the keyboard shortcuts:
- Mac: ⌥ Option + ⌘ Command +K
Creating a pin component
Duplicating my main components into two instances, we now have three of the same thing. Each has an independent position on the canvas, but are otherwise identical.
And here is the magic
Any change we make to our Component is immediately reflected in its instances
Instances: they are the perfect reflections of the component they represent.
Since any change to a Component is reflected in an instance, what happens if we change something inside an instance? Does that change simply disappear when the Component is modified? No, that’d be crazy.
Style and Property Overrides
Changes made to instances can be thought of as overrides of the original Component’s style and properties. Let’s see what happens if we override the color and stroke in our instances, and then change the original Component:
Any property of any part of an instance can be overridden, including any sublayers and their properties. This makes the possibilities virtually endless.
When we change our minds and want to clear the overrides from our instances, we can simply select the things we want to reset and choose “Reset all overrides.”
Creating nested components
Have you heard about atomic design? Well this has been introduced just a few years ago when design system was emerging across organizations. It is the concept of nested components.
From a single component (atoms) to a molecule (a few instances inside a bigger components) etc..
And yes nesting is infinite.
Now that you've understood how it works and the value of atomic design it's time to learn the best practices.
- Everytime you find yourself duplicating something ask yourself: should I create a component instead?
- Create pixel-perfect components from the ground up
- Add auto-layout to your layers
- When starting from scratch create a dedicated page in your file where you have all of your Main components. (This will later be your design system)
- If you're starting from an existing design system. Make sure it is not too complex for you to adjust if to your project style and not too empty to loose time re-creating everything from scratch.
- You'll find my own design system I've consolidated over the years that helped me save time freelancing with world-class startups.
- The most powerful library to kickstart any new project beautifully! (available in premium pack)
I recommend you take 30mn here to play with
- Creating your first components
- Overwrite instance properties
- Creating a complex and pixel-perfect component like a card