Buy

Components and states

Make a layer a component once and place it anywhere. Edit the original and every copy follows. Give it states and it reacts to hover, press and click when you play or present.

Make a component

Name the layer first, with slashes to group it, such as Button/Primary/Small. Then select it and press ⌥⌘K, or click Create component under its name in the properties.

The original, called the main, moves to the project's Design System canvas, onto a board named for the first part of its name, such as Button. A copy of it, called an instance, takes its place where you made it. Editing that instance changes only it, so to change the component itself, select the instance and click Go to main.

A component you make on the Design System canvas itself stays where it is.

Place instances

Open the Assets tab (⇧I) and choose Components. Click one to place it, or drag it onto the canvas. Duplicating or pasting a main also makes an instance of it.

Change an instance

Edits to the main reach every instance on every canvas, except for what you changed on an instance, which it keeps. Inside an instance you can hide or reorder layers, but not delete them.

Under the instance's name in the properties:

  • Go to main takes you to the main.
  • Reset puts back what you changed.
  • Detach (⌥⌘B) turns the instance into plain layers.

Slots

A slot is a frame inside a main where each instance can hold its own layers, like the rows of a list or the body of a card. Select the frame in the main and check Slot in the Component section. Instances can then add, reorder and remove their own layers there, and edits to the main leave them alone.

States

A state is another main with the same layer names, named after the component: Button/Primary at rest and Button/Primary/Hover when you point at it. Layers pair up by name, so a state only changes what differs.

To add one, select the main and click + in the Interactions section.

  • New hover state, New pressed state and New selected state copy the main as that state and link it.
  • On hover, On press and On click link a state that already exists.

Each link has a duration and an easing. Pick a motion token from the menu beside the field, or type any CSS value.

Play

Press ⇧P, or choose Play in the canvas menu, to try your components on the canvas. They change as you hover, press and click, moving in the timing of each link. Press Esc to go back to editing.

Components play the same way when you present.