How to buildOctober 11, 202614 min read
UX/UI design: from research to a design systemStep 6 of 9

Figma from scratch: frames, Auto Layout and components

In short

Four concepts are enough to start working in Figma: a frame is the container for a screen or element; Auto Layout is the set of rules a frame uses to arrange its contents (direction, padding, gap, Hug and Fill); a component is a main element whose copies update with it; variants and component properties are its states and adjustable parts. These four building blocks make up a button, a card and a whole screen that a developer later opens in Dev Mode.

TutorialLevel: BeginnerFigmaPractice: ~1.5–3 h

After this you will be able to

  • Build a screen from frames and nested Auto Layout with the right Hug contents, Fill container and Fixed settings
  • Turn a button into a component with Type and State variants and properties for its label and icon
  • Build a responsive product card that survives a long title and width changes
  • Explain how a style differs from a variable and what a developer sees in Dev Mode

Verified with

Figma Design (help.figma.com, 2026-10-11)

Checked against docs: October 11, 2026

Contents
  1. 01The Figma interface: files, pages, frames, layers
  2. 02Frames and constraints
  3. 03Auto Layout: direction, padding, alignment, Hug and Fill
  4. 04Components and instances
  5. 05Variants and component properties
  6. 06Styles and variables: colors, text, spacing
  7. 07Practice: a responsive product card
  8. 08Dev Mode and developer handoff

The Figma interface: files, pages, frames, layers

Every step in this lesson was checked against the official help.figma.com documentation on the review date. Commands and panels are named as they appear in the interface. Figma moves buttons around regularly, so if something has moved, search for the command by name in the Help Center.

A Figma Design file lives in the cloud: several people can work in it at once, and versions are saved automatically. The editor has five areas:

Toolbar

What’s there
Frame, shapes, Text, comments
What for
Creating layers

Navigation bar (left edge)

What’s there
File, Assets, Variables and other tabs
What for
Switching between layers, components and variables

Left sidebar

What’s there
Contents of the selected tab: pages and layers, the component library
What for
Seeing the file’s structure

Right properties panel

What’s there
Size, Auto Layout, fill, stroke, effects, component properties
What for
Adjusting the selected layer

Canvas

What’s there
Frames with designs
What for
Drawing and arranging

The File tab (Alt+1 on Windows, Option+1 on Mac) shows pages and layers. Pages are separate canvases inside a file. The Help Center suggests using pages for stages of work and keeping main components on a dedicated page. For this lesson, create three: Explorations for drafts, Designs for finished screens, Components for main components. On the free Starter plan a team file is limited to three pages — exactly enough.

Every object on the canvas is a layer. Layers nest: a top-level frame is usually a screen, with nested frames inside for the header, cards and buttons. Figma’s layer hierarchy maps directly onto an HTML element tree: the more carefully you name and group layers, the easier the developer’s job.

Frames and constraints

A frame is a container layer. Unlike a group, a frame has its own size, fill, stroke, corner radius and content clipping (Clip content), and only frames get Auto Layout, constraints, layout guides and prototyping. The Frame tool is F or A. Clicking the canvas creates a frame, dragging creates one of a custom size, and the right panel offers presets: Phone, Tablet, Desktop and more. To wrap selected layers in a frame, press Ctrl+Alt+G (Option+Command+G on Mac).

Constraints answer one question: what happens to a layer when its parent frame is resized. Horizontally you can choose Left, Right, Left and right, Center and Scale; vertically — Top, Bottom, Top and bottom, Center and Scale. The default is Top and Left. They live in the Position section of the right panel.

Left

What the layer does when the frame stretches
Keeps its distance from the left edge
Example
A logo in the header

Right

What the layer does when the frame stretches
Keeps its distance from the right edge
Example
A “Log in” button on the right

Left and right

What the layer does when the frame stretches
Keeps both distances and stretches
Example
A full-width search field

Center

What the layer does when the frame stretches
Stays centered
Example
A modal title

Scale

What the layer does when the frame stretches
Keeps its size and position as a percentage of the frame
Example
A decorative element
Horizontal constraints, per the Figma Help Center

Auto Layout: direction, padding, alignment, Hug and Fill

Auto Layout is a frame property that arranges child layers by rules and reflows them when content changes: a button grows with its label, a list closes the gap when an item is hidden. Add it with Shift+A or the Add auto layout button in the right panel. Figma suggests a direction, which you can change.

Vertical / Horizontal

What it does
Stacks layers in a column or a row
Closest in CSS
flex-direction: column / row

Wrap

What it does
Moves layers to a new row or column when space runs out
Closest in CSS
flex-wrap: wrap

Grid

What it does
Places layers in columns and rows; layers can span several cells
Closest in CSS
display: grid

Padding

What it does
Space between the frame’s edges and its contents
Closest in CSS
padding

Gap (number or Auto)

What it does
Distance between layers; Auto distributes them as Between, Around or Evenly
Closest in CSS
gap / justify-content

Hug contents

What it does
The frame wraps tightly around its contents
Closest in CSS
content-based width (fit-content)

Fill container

What it does
The layer takes all available space in its parent
Closest in CSS
flex: 1 or cross-axis stretch

Fixed

What it does
The size stays fixed
Closest in CSS
width / height in pixels

Ignore auto layout

What it does
The layer leaves the flow but stays in the frame
Closest in CSS
position: absolute
Auto Layout settings and their closest CSS counterparts (an approximate comparison)

Resizing is set separately for width and height — in the Width and Height dropdowns. Key rules from the Help Center: Hug contents is available only on the Auto Layout frame itself, Fill container only on its children. If any child is set to Fill, the parent stops hugging on that axis and becomes Fixed. To cap stretching, use Add min width / Add max width (and the same for height).

Let’s build the button from the lesson on component states:

  1. Label

    Pick the Text tool (T), click on the Explorations page and type “Book now”. Set 16 px, SemiBold or Bold.

  2. Auto Layout

    Select the text and press Shift+A. The text ends up inside a new Auto Layout frame. Rename the frame to button (Ctrl+R on Windows, Command+R on Mac).

  3. Spacing

    Direction: Horizontal. Horizontal padding 20, vertical padding 12. Gap 8 — you’ll need it once an icon appears.

  4. Resizing and look

    Width and height: Hug contents. Fill: the brand color, text: white, corner radius: 10.

  5. Check

    Change the label to “Book an appointment” — the button should grow by itself and keep its padding. If it doesn’t, check that the frame isn’t set to Fixed width.

Components and instances

A component is a reusable element. The main component defines its properties; instances are linked copies that receive every change made to the main one. Change the radius on the main button and every button in the file’s designs follows. Components are marked with a purple icon in the layers panel.

  1. Create a component

    Select the button frame and click Create component in the right panel, use the right-click menu or press Ctrl+Alt+K (Option+Command+K on Mac). Move the main component to the Components page.

  2. Insert an instance

    Open the Assets tab (Alt+2 / Option+2) and drag the component onto the canvas. Other ways: drag the main component while holding Alt (Option), or copy and paste it.

  3. Override

    On an instance you can change text, fill, stroke, effects and the layer name, and swap a nested instance such as an icon. These changes are called overrides.

  4. Find the main component

    Right-click the instance → Go to main component.

You can change on an instance

  • Text and its properties: font, size, line height
  • Fill and stroke of layers
  • Shadows and blurs
  • Nested instances (swap), such as an icon
  • Auto Layout padding and gap

You can’t change on an instance

  • Layer order
  • Layer positions inside the component, including in Auto Layout
  • Constraints
  • Adding new layers — you can only hide existing ones

To reset overrides, open More actions next to the component name in the right panel: Reset → Reset all changes. The same menu has Push changes to main component, which moves an instance’s edits into the main component; it works only when the main component is in the same file. Detaching an instance turns it into a plain frame and breaks the link: do it rarely and deliberately, otherwise design system updates never reach that spot.

Variants and component properties

A variant is one component inside a component set that groups similar components. A primary and a secondary button in default, hover, pressed and disabled states are not eight separate components but one set with two variant properties. Each variant is named Property=value, for example Type=Primary, State=Hover. The Help Center stresses that all variants in a set share the same properties while each has a unique combination of values. If two variants end up with the same combination, Figma flags a conflict.

Variant

Used for
Variants within a set: state, size, color
Button example
Type: Primary / Secondary; State: Default / Hover / Pressed / Disabled

Text

Used for
Which text can be edited from the right panel
Button example
Label: “Book now”

Boolean

Used for
Showing or hiding a layer
Button example
Show icon: true / false

Instance swap

Used for
Which nested instance can be swapped
Button example
Icon: arrow, phone, calendar

Slot

Used for
A flexible area where content can be added in an instance
Button example
Mostly for cards and modals, not buttons
Five types of component properties, per the Figma Help Center
  1. A variant property

    Select the main button component. Right-click → Main component → Add variant. Figma creates a copy and combines both into a set with a dashed purple border.

  2. Name the properties

    Select the set. In the Properties section of the right panel, double-click the property name and call it State. Values: Default, Hover, Pressed, Disabled — add variants with the button below the set or by duplicating (Ctrl+D).

  3. A second property

    Add a Type property with Primary and Secondary values. Draw the differences as in the variant × state matrix from the previous lesson: hover is darker, disabled is muted.

  4. A text property

    Inside the main component, select the text layer. In the Text section, hover over the text field, click Apply variable/property → Create variable/property, choose Property in the Create dropdown and name it Label.

  5. The icon

    Add an icon instance to the button. For its visibility, create a Boolean property Show icon (Appearance section); for swapping, an Instance swap property Icon (the Apply instance swap property button at the top of the right panel).

  6. Check

    Insert an instance: the right panel should show Type and State dropdowns, a Label field and a Show icon toggle. The default variant is the one in the top-left corner of the set.

Styles and variables: colors, text, spacing

A button color typed by hand into every layer is the same problem as a button redrawn on every screen. Figma offers two mechanisms for a single source of values.

Style

  • A set of properties applied together: font, size, spacing in one text style
  • Types: color, text, effect, layout guide, animation
  • A style can’t be nested in another style or variable
  • Good for typography and shadows

Variable

  • One raw value: Color, Number, String, Boolean, Timing, Easing
  • Can reference another variable of the same type (alias) — the basis for tokens
  • Supports modes: light and dark themes, languages, device sizes
  • Good for colors, spacing, radii

Variables open from Navigation bar → Variables. There you create a collection and variables such as color/brand, color/on-brand, space/padding-x, radius/button. To apply a color variable, click Apply styles and variables in the Fill or Stroke section and pick it; in the shared picker, variables appear as square swatches and styles as round ones. To apply a number variable to padding or radius, press = in the value field.

For handoff, a variable has Code syntax — a name for code (Web, Android, iOS) that later appears in Dev Mode snippets. If the project’s CSS calls the color --color-brand, use exactly that — the developer sees a familiar name instead of a hex code.

Practice: a responsive product card

Let’s build a product card that adapts to its column width and doesn’t break with a long title. It is based on Figma’s official mini-project with a responsive card; we swapped the podcast card for a product and added the button component.

  1. Photo

    Create a 280×200 frame (F), name it image, corner radius 8. In the Fill section, choose the Image type and upload a product photo.

  2. Text block

    Two text layers: the title (16 px, Bold) and the price (16 px, Regular). Select both, Shift+A, Vertical direction, Gap 4, name the frame meta. Set both texts to Fill container width.

  3. Long title

    For the title, open Type settings, turn on Truncate text and set Max lines to 2: long text is cut with an ellipsis instead of stretching the card.

  4. Button

    Drag a button instance from Assets, set Label to “Add to cart” and width to Fill container.

  5. Card

    Select image, meta and the button, Shift+A, Vertical direction, Padding 16, Gap 12, add a fill and a corner radius of 12. Name the frame product-card.

  6. Resizing

    image: Fill container width, Fixed height. meta: Fill container width, Hug contents height. The card itself: Add min width 200, Add max width 360.

  7. Component

    Select product-card and click Create component. Create Name and Price text properties for the title and price.

  8. Check

    Stretch the card from 200 to 360 px: the photo and the button stretch, spacing stays the same, and the card stops at its limits. Paste a three-line title — two lines and an ellipsis are visible.

Dev Mode and developer handoff

Dev Mode is Figma’s developer workspace: you inspect sizes, spacing, colors and variables, see generated code, download assets and compare versions. Turn it on with the toggle in the toolbar or Shift+D. According to the Help Center, Dev Mode is available on all paid plans and requires a Full or Dev seat — worth clarifying before a project starts.

  • Mark as ready for dev — the designer marks a frame, component or section as ready, and the developer sees it in a dedicated list
  • Inspect: layer name and type, properties as code (CSS and other languages) or a list, applied styles and variables
  • Compare changes — what changed since the last version; for an instance, Compare with main component
  • Explore component behavior — a playground for switching variants and properties without changing the file
  • Asset export to PNG, JPG, SVG and PDF, annotations and measurements
  • Layers are named by meaning (button, product-card, meta), not Frame 247
  • Repeated elements are component instances, not detached copies
  • Variants are named like props in code: Type, State, Size
  • Colors, spacing and radii are variables or styles
  • Every interactive component has its states drawn, including focus and disabled
  • Cards and screens are tested by stretching to their minimum and maximum widths
  • Finished screens are marked Ready for dev
Tell us about your task — we'll review your request and get back to you

Got a project?
We'll scope and estimate it — for free.

Tell us about the product or the problem. After reviewing the task we'll come back with an architecture, a timeline and a price for the first version.

  • Scope and risks estimated before we start
  • NDA — yours or ours
  • Work starts within a week

Please do not send passwords, access keys or source code through this form — we will agree a safe way to share access separately.

By clicking the button you agree to the processing of your personal data.