Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 36 ยท Components and Variants

Components and Instances

Learn how Figma main components and instances work, how overrides behave, and how to detach, reset and update instances safely.

A component is a reusable design element that you build once and use many times. A button, an avatar, a navigation bar and a form field are all good candidates. When you change the original, every copy updates. That single idea is what turns a pile of drawings into a system you can maintain.

Figma uses two words for the two sides of this relationship. The main component is the original. An instance is a linked copy of it. You edit the main component to change every instance at once, and you edit an instance to change only that one copy.

Figma itself cannot run on this site. The code examples in this lesson are small, clearly labelled JavaScript stand-ins that model how components and instances behave, so you can experiment with the rules. They are not the real Figma engine.

Creating a component

Select one or more layers, then choose Create component from the toolbar or the right-click menu. The shortcut is Ctrl+Alt+K on Windows and Cmd+Option+K on macOS. The selection becomes a main component and is marked with a purple diamond icon in the layers panel. The frame or group you selected is turned into the component itself.

Good practice before you convert:

  • Name the layers inside it clearly (label, icon, background). You will see why in the next lessons.
  • Build it with auto layout so that it grows with its text.
  • Use styles or variables for colors and text, not hard-coded values.

To create a new copy, drag the component from the Assets panel onto the canvas, or hold Alt (Option) and drag the main component. Hold Alt and drag an existing instance and you get another instance, not a new main component.

Main component versus instance

A quick way to tell them apart: the main component has a filled purple diamond; an instance has an outlined diamond. Selecting an instance shows a Go to main component action, useful in files with hundreds of frames.

flowchart LR
    M["Main component<br/>Button"] --> I1["Instance<br/>Sign in"]
    M --> I2["Instance<br/>Cancel"]
    M --> I3["Instance<br/>Pay now"]
    I1 -. "overrides: text" .-> I1

Every instance stays linked to its main component; overrides live only on the instance.

What an instance can override

You may change certain properties of an instance without breaking the link. These are called overrides:

  • Text content of text layers.
  • Fills, strokes and effects, including swapping to another style.
  • Visibility of layers.
  • Layer sizes and, in some cases, auto layout settings.
  • Nested instances, which can be swapped for other components.

You cannot add or delete layers inside an instance, or reorder them, unless you detach it. If a design needs different structure, that is usually a sign you need a variant or a component property.

Overrides and updates: the merge rule

What happens when you override the fill of an instance, and then the main component's fill changes? The override wins on that instance, because the property you touched is now locally set. Properties you did not touch keep following the main component. You can clear overrides with Reset all overrides (right-click menu) or reset a single property from the panel.

This rule, "local values win; untouched values follow the source", is simple to model:

JS Stand-in: resolving instance overrides

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Look at the second table: save follows the new radius and the new fill, because it only overrode the label. cancel keeps its gray fill because it set a local one.

Detaching an instance

Detach instance (Ctrl+Alt+B, Cmd+Option+B) cuts the link and turns the instance into an ordinary frame. Do it only when you really need a one-off layout. Once detached, the layer no longer receives updates and it stops being counted in library analytics. Detached instances are among the most common reasons a design system drifts, so be deliberate about them.

You can also Push overrides to main component when you decide an instance's local change should become the new default. Use it sparingly, because it changes every other instance that has not overridden that property.

Counting what you changed

Think of a component like a function: the main component is the definition, and each instance is a call with arguments. If you change the definition, every call is affected unless it passes its own argument.

JS Stand-in: propagating a change to many instances

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Practical rules

  1. One source of truth. Never copy-paste a component's frame to make a variation. Build a variant or a property.
  2. Name your main components with slashes. Button/Primary makes the Assets panel show a folder tree.
  3. Keep main components together on a dedicated page, often called "Components", away from screens.
  4. Don't deeply override. If most instances override the same property, move that into the main component or make it a property.
  5. Check for detached layers when a team member says "my button did not update".

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does an outlined purple diamond on a layer mean?

    Instances show an outlined diamond; main components show a filled diamond.
  2. 2. An instance overrides its fill. Later the main component's fill changes. What does that instance show?

    Local overrides win; only untouched properties follow the main component.
  3. 3. Which action cuts the link between an instance and its main component?

    Detach instance converts the instance into a plain frame that no longer updates.
  4. 4. Which of these can you NOT do inside an instance without detaching it?

    Adding or deleting layers changes the structure, which only the main component can define.

Summary

  • A main component is the source; instances are linked copies.
  • Instances can override text, fills, visibility and nested instances, but not structure.
  • Untouched properties follow the main component; overridden ones keep their local value.
  • Detach instance breaks the link, so use it rarely.
  • Name components with slashes and keep them on a dedicated page.

Next: Component Properties