NewA landing page layout checklist that actually converts
Tools

Figma auto layout: a practical guide to responsive components

How to use Figma auto layout for components that resize like real UI: direction, spacing, padding, hug vs fill, nesting, min and max widths, wrap and common mistakes.

Creative Pouch · · 3 min read

A person using a digital drawing tablet and a laptop, with colour swatches and markers on the desk
Photo: Theme Photos on Unsplash

Auto layout is the feature that turns static Figma drawings into components that behave like real interface elements. Buttons grow with their labels, cards stretch to fill a column, lists reflow when an item is added. It also makes handoff easier, because auto layout maps closely to CSS flexbox.

Here’s how to use it well, from the basics to the details that make components robust.

The core idea

An auto layout frame arranges its children in a row or column and manages the space between and around them. Instead of positioning each layer by hand, you set rules:

  • Direction: horizontal, vertical, or wrap.
  • Gap: the space between items.
  • Padding: the space between the frame’s edge and its content.
  • Alignment: where items sit inside the frame.

Select layers and press Shift + A to wrap them in an auto layout frame.

Hug, fill and fixed

Every layer inside auto layout has a resizing behaviour for width and height:

  • Hug contents: the frame is exactly as big as its content plus padding. Right for buttons, tags and chips.
  • Fill container: the layer stretches to take the available space in its parent. Right for inputs, cards in a column and text that should wrap.
  • Fixed: a set size that doesn’t change. Use it sparingly, mainly for icons and avatars.

Most layout bugs come from the wrong choice here. A rule of thumb: containers hug, content inside a column fills, and only truly fixed things are fixed.

Build components from the inside out

Start with the smallest pieces and nest them:

  1. Button: horizontal auto layout, padding 12 × 20, gap 8, hug × hug. Icon fixed at 16 × 16, label hug.
  2. Card content: vertical auto layout, gap 8, fill width. Title and description set to fill width so text wraps.
  3. Card: vertical auto layout with image (fill width, fixed height) and the content frame, padding 16, gap 12.
  4. Card grid: horizontal auto layout with wrap, gap 24, cards with a min width so they reflow to new rows.

Nesting like this mirrors how the interface is built in code, which makes components predictable to resize.

Min and max widths

Set a min width on cards and inputs so they never get too narrow, and a max width on text blocks so line length stays readable (around 60–75 characters). Combined with fill container, this gives you behaviour that matches responsive CSS.

Spacing with tokens

Use a spacing scale (for example 4, 8, 12, 16, 24, 32) for gaps and padding instead of arbitrary values. If your team uses variables, bind gap and padding to spacing variables so a change in the design system updates every component.

Absolute position for overlays

Some elements shouldn’t take part in the flow: a notification badge on an icon, a “close” button in a card corner. Select the layer inside the auto layout frame and enable absolute position. It stays inside the frame but ignores gap and padding.

Common mistakes

  • Fixed-width text layers that overflow or leave odd gaps. Text should usually be “fill” (wrapping) or “hug” (single line).
  • Spacer rectangles instead of gap and padding. They break when content changes.
  • Too many wrappers. Every extra frame is one more thing to maintain. Nest only when it reflects a real group.
  • Mixed alignment inside a list, which makes items jump when text length changes.

From auto layout to code

Auto layout corresponds closely to flexbox: direction is flex-direction, gap is gap, padding is padding, hug is width: fit-content, fill is flex: 1, and wrap is flex-wrap: wrap. Developers can read the structure straight from the layers panel, and fewer things get lost in handoff. If you also move designs in the other direction, from code to Figma, read Reverse handoff: when the code comes first.

Summary

Think in rules rather than positions: choose hug, fill or fixed deliberately, build components from the inside out, use min and max widths, and keep spacing on a scale. Components built this way resize like real UI, survive content changes and translate cleanly into code.

  • #figma
  • #auto layout
  • #components
  • #design systems
  • #ui design

More in Tools