A real product might have hundreds of buttons. If each one is a separate group of layers, changing the corner radius means editing hundreds of objects. Components solve this: you design the button once and reuse it everywhere, and changes flow through the whole file.
Main components and instances
- The main component is the original. It shows a four-diamond icon in the Layers panel.
- Instances are copies. They show a single diamond icon.
- Edit the main component, and every instance updates.
Step 1: Create a button component
- Build a button with auto layout (text plus padding, see the auto layout tutorial).
- Select it and press Ctrl + Alt + K (Windows) or Cmd + Option + K (macOS), or click the Create component button in the toolbar.
- Rename it clearly, for example Button.
Pro tip: Name layers inside the component too (“Label”, “Icon”). Clear names make overrides and properties much easier later.
Step 2: Add variants
With the component selected, click Add variant in the right sidebar. Figma creates a component set with a purple dashed border.
- Duplicate the variant for each state you need: Default, Hover, Pressed, Disabled.
- Rename the property from “Property 1” to State and give each variant its value.
- Add another property, Size, with Small, Medium and Large.
Now designers can pick “Size: Large, State: Hover” from simple dropdowns on any instance.
Step 3: Add component properties
Component properties keep your variant count under control:
| Property | Use it for | Example |
|---|---|---|
| Text | Editable label from the sidebar | Button label |
| Boolean | Show or hide a layer | Show icon: true/false |
| Instance swap | Swap a nested component | Choose which icon |
| Variant | Switch between variants | Size, State |
Select the label layer, and in the Text section click the property icon to create a Text property. Do the same for the icon layer’s visibility to create a Boolean property.
Step 4: Use and override instances
Drag instances from the Assets panel. Change the label, toggle the icon, pick a size. These overrides are kept even when you later restyle the main component.
Step 5: Share it as a library
To use your components in other files, publish them from the Assets panel as a library, on plans that support team libraries. Updates then appear as notifications in every file that uses them.
Watch out: Do not detach instances (Ctrl+Alt+B or Cmd+Option+B) to make quick edits. A detached instance no longer receives updates, which is how design systems slowly fall apart.
Practice
Create a button set with three sizes, four states and a boolean icon property. Then build a small login form using only instances. Change the main component’s corner radius and watch the whole form update at once.