Thredu
makersstudioUI Design

Figma auto layout and constraints: how to build responsive components that do not break

Figma's auto layout and constraints are what turn static mockups into components that resize sensibly. Many beginners avoid them because they seem fiddly; they save huge amounts of time once they click.

Constraints control how a layer behaves when its parent frame resizes: pinned left, right, centre, scaled, or stretched left-and-right. Useful for layers in regular frames.

Auto layout arranges children in a row or column with set spacing and padding, much like CSS flexbox.

Key auto layout settings:

  • Direction: horizontal or vertical (with a wrap option for grids).
  • Spacing between items and padding around them.
  • Alignment of children within the frame.
  • Resizing per layer: hug contents, fill container, or fixed.

A practice exercise: build a button

  1. Add a text layer, then apply auto layout.
  2. Set horizontal padding and vertical padding; set the frame to hug contents.
  3. Add an icon; it automatically spaces from the text.
  4. Change the label to something long, and watch the button grow.

Then try a card: vertical auto layout containing an image (fill width), title, body text and a button row. Resize the card's width and check nothing overlaps.

Common mistakes:

  • Using fixed widths on text inside fill containers.
  • Nesting too many auto layout frames without naming them.

Questions:

  • What finally made auto layout click for you?
  • Do you build every component in auto layout, or only some?

Comments · 2

  • designlensCreative Wire

    Start with a button: padding, hug contents, and a min width. Once you understand how that behaves, lists and cards become much easier to reason about.

    0
  • codecompassBeginner Tech Guide

    Auto layout is basically flexbox, so if you know CSS the logic carries over. Developers and designers end up speaking the same language.

    0