Design

Components and variables

Design a layer once and reuse it: components, variants, slots, and variables with modes such as light and dark.

Keys on this page are shown for your computer, with the other platform's keys after them.

Components

A component is a layer you design once and use many times: every copy, an instance, follows the main component when it changes. Select layers and press Ctrl+Alt+K on Windows (⌥⌘K on Mac) (or Create component in the inspector). One selected frame becomes the main component; other selections are wrapped in a new frame first.

A main product card component and two instances of it on the board, one selected
A main product card component and two instances of it on the board, one selected
  • Create instance from the main component's inspector, or drag the component from Assets (its Components list) onto the board. Click a component there to place it in the middle of the view.
  • Overrides: change text, colours or anything else in an instance, and the change stays on that instance. Reset overrides in the Instance section undoes them, for the whole instance or for one layer inside it.
  • Swap component: pick another component in the instance's Swap row, or hold ⌥ (Alt on Windows) while you drop a component on an instance. Overrides stay where the layers match.
The Instance section: its component, Reset overrides, Detach instance and Swap component
The Instance section: its component, Reset overrides, Detach instance and Swap component
Swap component open on an instance, listing the board's components
Swap component open on an instance, listing the board's components
  • Detach instance (Ctrl+Alt+B on Windows (⌥⌘B on Mac)) makes the instance a plain frame; instances nested in it stay instances.

An instance can be resized: its layers follow their constraints. Components belong to their board: copying or duplicating a main component makes a plain frame, not a second main component.

Variants and component properties

Variants are versions of one component, such as a button's sizes and states, kept together in a component set. Select several main components and choose Combine as variants, or Add variant on a component set or a variant.

A button component set with Size and State variants, and an instance of it below
A button component set with Size and State variants, and an instance of it below

Name each variant as properties and values, such as Size=Large, State=Hover, or set the values in its Variant section. Each property becomes a menu on the instance, so you switch an instance between variants there; the top-left variant is the default. The inspector warns when a variant is not named this way, or when two have the same values. Give a variant an interaction that changes to another variant to make an interactive component (see Prototype and Present).

An instance's Size and State menus, one per variant property
An instance's Size and State menus, one per variant property

Component properties let an instance change parts of a component without overrides. On a main component, click + (Add property) and pick a kind, then bind a layer inside to it under Component properties:

  • Text: the text a text layer shows.
  • Boolean: whether a layer is visible.
  • Instance swap: which component a nested instance shows.
  • Variant (on a component set): a variant property.
Add property on a main component: Text, Boolean and Instance swap
Add property on a main component: Text, Boolean and Instance swap

Each instance shows its properties' values in its Instance section.

Slots

A slot is a frame in a component that each instance fills with its own layers, such as the body of a card or the items of a list. Select a frame inside a main component and choose Convert to slot (Ctrl+Shift+S on Windows (⇧⌘S on Mac)).

Component properties on the main card: its Media frame is the Slot
Component properties on the main card: its Media frame is the Slot

In an instance, draw, drop or paste layers into the slot: they belong to that instance. The slot's switch shows or hides the component's own layers in it. Delete contents empties the slot, and Reset gives it back the component's layers. Only an instance's own slots can be filled, not those of instances nested inside it.

Three product cards from one component: the last fills its slot with its own picture
Three product cards from one component: the last fills its slot with its own picture

Variables and modes

Variables are named values (colours, numbers, text, on or off, timings and easings) you apply to layers, so one change updates every layer that uses them. Modes give each variable a value per theme, brand or size, such as light and dark. Open them with Variables in the board's inspector (nothing selected), or Open variables in a layer's Apply variable menu.

The Variables dialog: a Theme collection with Light and Dark modes and colour variables
The Variables dialog: a Theme collection with Light and Dark modes and colour variables
  • Create collection, then Create variable and pick its type: Colour, Number, String, Boolean, Timing or Easing. A slash in a name (color/brand) puts variables in groups.
  • Add mode adds a column: each variable gets a value per mode. The first mode is the default.
  • Use another variable in a cell makes it stand for another variable of the same type (an alias).
  • Apply a variable: select a layer, click Apply variable in its Variables section, pick the property (fill, stroke, text colour, opacity, corner radius, width, height, font size, gap, padding, text, font, visibility and more) and the variable. A text can show a string or a number variable, so a counter set by a prototype shows its count. Detach it from the same section. Editing a bound value by hand detaches it too.
  • Pick a mode: select a frame, and under Variables choose the collection's mode. Everything inside uses it, until a frame inside picks another. An instance can pick its own mode, so one component shows light or dark per instance.
Apply variable on a selected frame, listing the properties a variable can drive
Apply variable on a selected frame, listing the properties a variable can drive

Timing variables set a frame's animation length, and Easing variables a keyframe's easing (see Keyframes and easing).

Design tokens: export and import

Variables travel to and from code and other design apps as design tokens. In the Variables dialog, click Export and choose:

  • Design tokens (JSON): the W3C design tokens format Figma reads, one file per collection and mode (several come as one zip).
  • CSS variables: one variables.css, with each collection's default mode in :root and other modes under a data attribute.
Export in the Variables dialog: design tokens (JSON) or CSS variables
Export in the Variables dialog: design tokens (JSON) or CSS variables

To import, click Import and pick one or more .tokens.json files, one per mode. Import tokens shows what the files change before anything is written: the collection they go into, new modes, and each variable as new, changed or the same. Files from Raelume name their collection; files from Figma go into the collection you pick. Variables are matched by name, and variables the files don't mention are left alone. Shadows, typography and other token types are left out. Downloading tokens is part of the paid plans.

Something missing? Tell us from the app, or read the Academy.PrivacyTermsStart creating