Skip to main content

Components and instances

A main component is the layer you edit; its instances follow it. You need this page when you create, copy, delete or detach one: a main component reacts to those commands differently than other layers. Also called: symbol, master (main component).

Creating components​

Where: right-click the selection → Create component (Ctrl + Alt + K) or Create multiple components.

  • A single plain frame becomes the component itself. Its children, layout and constraints stay as they are.
  • Any other single layer — a shape, a text layer or an instance — is wrapped in a new component the size of its bounding box, which takes its name. Several selected layers are wrapped together in one component.
  • Wrapped layers are set to Scale on both axes under Constraints, so they resize with the component.
  • Create multiple components makes one component per selected layer by the same rules. It exists only in the context menu, with two or more layers selected.
  • Components don't nest: both commands are missing while the selection sits inside a component. A component inside the selection is moved out onto the page, to the right of the new component, and an instance takes its place.
  • A selection that contains a component set or a variant is refused with a message. Move the set out of the selection first.

How instances come about​

An instance comes from the Components panel or from copying a main component; there is no insert command.

  • Dragging a row of the Components panel onto the canvas places an instance of its component.
  • Duplicating (Ctrl + D, Alt-drag) or copy-pasting a standalone component yields an instance of it, never a second component.
  • Inside a component set the same commands yield another variant, and a component pasted into a set becomes a variant of it.
  • Alt-dragging a variant out of its set yields an instance of that variant. A plain drag out of the set moves the variant, which stays a component.
  • Cut and paste moves a main component. Its instances keep following it.
  • For an independent copy, duplicate the component, detach the instance, then run Create component on the frame.

The Go to main component button in the Properties panel header selects an instance's main component.

The Components panel​

Where: the Components tab at the top of the left sidebar, next to Layers and Assets.

  • The panel lists every main component and component set in the document, sorted by name, each with a small picture of it as the canvas draws it. A / in a name makes no folder.
  • Deleted components stay listed after the others, with a faded picture, so you can still place instances of them. They have no main component to go to: right-click one → Restore deleted component to bring it back (→ Deleting and restoring a main component).
  • A component set expands to one row per variant name, showing the variant an instance shows by default: Primary for Primary, Primary:hover and Primary:active. State variants aren't listed (→ Naming states). A set whose variants all share one name doesn't expand. The set's own row pictures the variant listed first.
  • A component nothing uses shows its name faded: no instance, swapped nested instance or Repeater places it on any page, nor inside a deleted component that is itself in use. Instances inside the component itself don't count. A variant row counts the instances in any of its states.
  • Hover a row to see which page its component is on, or that it was deleted, and whether it is unused.
  • Find components above the list keeps the rows whose name contains what you type and opens the sets holding a match. Esc clears it.
  • Drag a row onto the canvas to place an instance, centered where you drop it, in the frame under the pointer: in a Flex frame at that position, in a Grid frame in that cell. A set's row places the variant listed first. An instance can't go inside the component it shows, so a drop there places it outside the component and says so.
  • Double-click a row, or right-click it → Go to main component, to select the component on its page and bring it into view. Right-click → Find uses lists its uses (→ Finding where a component is used). On a variant row these are the uses of that variant in any of its states, and on a set's row those of the whole set. A component nothing uses offers no Find uses.
  • Select a row to see its component larger at the bottom of the panel, with its name and its page. Find uses… lists its uses, or Unused shows in its place when nothing uses it. Go to main component goes to it. A deleted component offers Restore deleted component there instead.
  • Right-click a component's or a set's row → Delete permanently to remove it from the document for good (→ Deleting a component permanently).

Finding where a component is used​

Where: right-click a main component, a variant, a component set or an instance → Find uses, or select one → Properties panel header → the More actions button → Find uses. Both are also offered in a document you can only view.

  • The search dialog lists every instance of the component on All pages, grouped by page, and every Repeater that shows it (→ Repeaters). This page narrows the list to the current page.
  • On an instance, Find uses finds the uses of its main component, and of the whole set when the main component is a variant. A variant you select yourself finds only its own instances.
  • Each entry names the top-level layer that holds it, then the instance it is part of when another component brings it along, for example Home › Card.
  • Clicking an entry, or moving to it with ↑ and ↓, selects it and shows its page. To change the instances to another component, select them and swap them (→ Swapping an instance).
  • The list does not update while it is open: run Find uses again after adding or removing instances. Typing in the search field above the list, which Ctrl + F focuses, returns to the usual search.

Deleting and restoring a main component​

Where: select one instance → Properties panel → Restore deleted component. The same link appears on the Interactions tab when the instance inherits interactions from the deleted component. In the Components panel, right-click a deleted component's row → Restore deleted component.

  • Deleting a main component hides it instead of destroying it, whether or not it has instances. Its instances stay instances and keep showing it. The same holds for a variant and a component set, and for every component inside a deleted frame. To remove one for good, delete it permanently (→ Deleting a component permanently).
  • While the main component is hidden, Go to main component is disabled.
  • Restore deleted component puts the component back into the parent it was deleted from and selects it. When that parent is gone, it lands in the nearest surviving parent, failing that on the current page. A component whose whole set was deleted comes back with the set.

Deleting a component permanently​

Where: Components panel → right-click a component's or a component set's row → Delete permanently. It works on deleted components and on those still on a page.

  • The component leaves the document instead of staying listed as deleted. A component set goes with all its variants.
  • Its instances are detached first, on every page and inside other components, and become plain frames that keep what they showed (→ Detaching an instance). So are instances that swapped a nested instance to it (→ Swapping an instance), and Repeaters that show it (→ Repeaters).
  • When there is anything to detach, a confirmation says how many instances and Repeaters will be detached. A component nothing uses is deleted at once.
  • The row of a single variant in a set doesn't offer it.
  • Ctrl + Z brings the component and its instances back in one step.

Detaching an instance​

Where: right-click an instance → Detach instance (Ctrl + Alt + B), or Properties panel header → the More actions button → Detach, offered while one top-level instance is selected. The context menu and the shortcut detach every selected instance.

  • The instance becomes a plain frame with ordinary layers. The layers keep what the instance showed, overrides and input values included; nothing stays bound to an input.
  • Interactions and object behaviors inherited from the main component are copied onto the frame and its layers, next to the instance's own (→ Interactions on instances).
  • Instances nested inside stay instances and keep their overrides. An instance inside another instance can't be detached on its own: detach the outer instance first.
  • Content held in the instance's own slots becomes ordinary layers.

Components belong to one document​

A component and its instances live in one document: there is no shared library, and nothing links a component to another document. Components and instances pasted into another document are independent copies that never sync with their source.