Skip to main content
How to use Main Components

Learn how to create and manage Main components.

Iselin Ekornes avatar
Written by Iselin Ekornes
Updated over 2 months ago

A Main Component is a Frame or Section that can be reused throughout your project. It preserves its style and structure, and any changes made to it will update across all instances where it is used.

Understanding Main Components and Instances

Main Components and their instances work together but serve different purposes in the design process. Understanding how each function is crucial to using them effectively.

What is a Main Component?

A Main Component is the original version of a design element, often referred to as the 'source of truth'. When you create a Main Component, you define its structure, style, and content. Any changes made to the Main Component are automatically synced with all instances, unless those instances have been manually overridden.

You can identify a Main Component by checking its label on the right-side panel or viewing its icon on the layers panel.

What is an Instance?

An Instance is a copy of the Main Component placed on the canvas. It inherits the design of the Main Component but allows for local overrides, such as changes to content or style, without affecting the Main Component or other instances.

Instances are marked with a label on the right-side panel and an icon on the layers panel to differentiate them from Main Components.

Finding Main Components

When a Main Component is created or added to a project, it is saved in the Main Components library.

To find Main components:

  1. Click the 'Add components' button in the left panel.

  2. Scroll to the 'Main components' section, or filter by selecting 'Main components' in the libraries dropdown. Learn more about libraries.

Note: Main Components are only available within the project they were created in. However, once placed on the canvas, you can copy and paste them into other projects, where they will be added as new Main Components.

Creating a Main Component

To create a Main component, follow these steps:

1) Combine Elements in a Frame or Section.

Gather a set of elements that you plan to reuse (such as headers, cards, or footers) in a Frame or Section.

2) Convert the Frame or Section to a Main Component.

Select the Frame or Section, then convert it to a Main component by:

  1. Right-clicking selecting 'Create Main component'.

  2. Clicking the 'Create component' button in the top right of the style panel.

  3. Using the keyboard shortcut: Command + Option + K (Mac) or CTRL + ALT + K (Windows).

Give the new component a meaningful name, as it will be added to your component library in the left panel.

Once created, the Frame or Section will change color, indicating it is now a Main Component.

Managing a Main Component

Editing a Main Component

To edit a Main Component, you need to enter the edit mode. You can do this by:

  1. Clicking 'Edit component' in the layers panel.

  2. Selecting 'Edit component' in the right-side panel.

  3. Right-clicking an instance and selecting 'Edit component'.

This takes you to a dedicated environment for editing the original design. Any changes you make here will update all instances unless they've been manually customized.

Tip: You can adjust the layout for different breakpoints and devices in this mode.

To save changes:

  1. Click 'Page' in the left panel breadcrumb.

  2. Or click 'Exit component mode' in the top right of the canvas.

All changes will automatically push to all instances, except those with manual overrides.

Renaming a Main Component

In the 'Add components' menu, hover over the component and click the overflow menu (...) to select 'Change name'. Enter the new name and click 'Save'.

Deleting a Main component

To delete a Main Component, follow the same steps for renaming, but select 'Delete main component' from the menu.

Managing an Instance

Instances allow you to customize a Main Component without affecting other instances or the Main Component itself. This is useful when you want to update content or experiment with design variations.

Editing an Instance

Any edits made to an instance are local and only apply to that specific instance. For example, you can change text, images, or colors without affecting other instances.

In the image above, you can see an example of an unedited instance to the left and an instance to the right with overrides on text, image, and background color.

If you make edits to the Main Component, you can see in the image below that the instance to the left has inherited an update from the Main component, while the instance to the right with overrides is not affected.

Limitations of Instances

Instances are linked to the Main Component and inherit its structure. Some limitations include:

To make these types of edits, you must update the Main Component.

Resetting an Instance

You can reset any overrides and restore the instance to match the Main Component by:

  1. Right-clicking the instance and selecting 'Reset all changes'.

  2. Clicking the 'Reset' button in the right-side panel.

To reset only specific styles, use the style indicator buttons in the right-side panel. Learn about style indicators here.

Updating the Main Component from an Instance

If you've made significant changes to an instance that you want applied to other instances, you can push those changes to the Main Component. Once pushed, the updates will apply to all instances that don't have manual overrides.

Detaching an Instance

If you want to fully disconnect an instance from its Main Component:

  1. Right-click the instance.

  2. Select 'Detach instance'.

This will turn the instance into a standalone frame or section, with no link to the Main Component.

Did this answer your question?