Skip to main content

Lesson 3 of 9

Figma Auto Layout - Building Flexible, Responsive Components

Auto Layout is Figma's system for creating frames that automatically resize and reflow their contents - equivalent to CSS Flexbox. It's the single most important feature in Figma for professional-quality design, and it's what separates designs that break when content changes from designs that adapt gracefully. Without Auto Layout, designers manually adjust every element when button text changes, forms gain a new field, or a card gets more content. With Auto Layout, all of that adjusts automatically, just as it does in real code. Mastering Auto Layout transforms your Figma workflow from static mockery to production-equivalent design.

50 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

Auto Layout Fundamentals

Auto Layout turns a regular Figma frame into a flexible container that automatically sizes itself based on its contents and distributes children according to defined rules. To apply: select a frame or group → press Shift+A (or right-click → Add Auto Layout). The frame is now an Auto Layout frame. There are four key properties every Auto Layout frame has. Direction: Horizontal or Vertical - should children stack left-to-right or top-to-bottom? Horizontal produces row-style layouts (navigation bars, button groups, form labels + inputs). Vertical produces column-style layouts (forms, lists, cards, vertically stacked content). Spacing (Gap): the distance between child elements within the container. Set to a value from your spacing scale (8, 16, 24px). Setting it to 'Auto' distributes available space equally between children (equivalent to CSS justify-content: space-between). Padding: internal space between the frame boundary and its children. Set all sides equally for symmetric components (buttons: 12px vertical, 24px horizontal). Set independently for asymmetric needs. Sizing: each side of an Auto Layout frame can be Fixed (specific pixel size), Hug (shrinks to fit content), or Fill (expands to fill available space in the parent container).

Diagram
Loading diagram…

Figma Auto Layout - Building Flexible, Responsive Components: Visual guide and core principles.

Auto Layout in Practice - Button to Full Layouts

  • A button with Auto Layout: Create a frame. Add text inside it. Apply Auto Layout (Shift+A). Set direction: Horizontal. Set padding: 12px vertical, 24px horizontal. Set width: Hug contents. Set height: Hug contents. Now change the button text - the frame automatically expands or contracts to fit the text. Add an icon next to the text - the frame accommodates it. This is fundamental to building true components
  • A form field: Vertical Auto Layout with a Label text at top and an Input frame below. Gap between label and input: 4px. The form field frame hugs its content height. When the label becomes multi-line, the frame expands automatically
  • Stacked card list: A parent container with Vertical Auto Layout and 16px gap contains multiple card components. Add a new card - it slots in perfectly. Remove one - the others close the gap. Set the parent's width to Fill and the container matches its parent width without manual adjustment
  • Wrapping (Figma 2022+): Auto Layout now supports wrapping - when children don't fit in one row, they wrap to a new row (equivalent to CSS flex-wrap). This enables tag clouds, badge collections, and responsive card grids within Figma itself
  • Nested Auto Layout: The real power comes from nesting. A Card is a Vertical Auto Layout containing a Horizontal Auto Layout (icon + title) and a Text frame. That Card is nested inside a Grid Auto Layout with wrap enabled. The entire layout from card internals to grid formation is controlled by nested Auto Layout rules - exactly mirroring how a developer would build this in code

Auto Layout vs Manual Layout - When to Use Each

Auto Layout is the default approach for: ALL components (buttons, form fields, cards, navigation items, modals), ALL vertical lists and feeds, ALL horizontal toolbars and navigation bars, and ANY layout where content amount varies. Manual layout (fixed-size frames with absolutely positioned children) is appropriate for: illustration and decorative graphics where precise pixel positioning matters, unique hero layouts where elements have specific artistic positions that aren't grid-based, and reference mockups (static screenshots used for documentation, not for design work). A practical way to think about it: if this will be built in code and content might change, use Auto Layout. If it's a one-off decorative element with no code equivalent, manual positioning is fine. The professional standard at companies like Airbnb, Figma, and Atlassian is that all components and all repeatable layout patterns use Auto Layout. When you open a design file from one of these companies, almost every frame has the Auto Layout indicator in the right panel.

Tip

Tip

Practice Figma Auto Layout Building Flexible Responsive Components in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Practice Task

Note

Practice Task - (1) Write a working example of Figma Auto Layout Building Flexible Responsive Components from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with Figma Auto Layout Building Flexible Responsive Components is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready ui ux code.

Key Takeaways

  • Auto Layout is Figma's system for creating frames that automatically resize and reflow their contents - equivalent to CSS Flexbox.
  • A button with Auto Layout: Create a frame. Add text inside it. Apply Auto Layout (Shift+A). Set direction: Horizontal. Set padding: 12px vertical, 24px horizontal. Set width: Hug contents. Set height: Hug contents. Now change the button text - the frame automatically expands or contracts to fit the text. Add an icon next to the text - the frame accommodates it. This is fundamental to building true components
  • A form field: Vertical Auto Layout with a Label text at top and an Input frame below. Gap between label and input: 4px. The form field frame hugs its content height. When the label becomes multi-line, the frame expands automatically
  • Stacked card list: A parent container with Vertical Auto Layout and 16px gap contains multiple card components. Add a new card - it slots in perfectly. Remove one - the others close the gap. Set the parent's width to Fill and the container matches its parent width without manual adjustment

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/9 done