Figma logoFigma Beginner 20 min

Figma Auto Layout Explained: Build Responsive Designs Like a Pro

Auto layout makes frames grow, shrink and space themselves automatically, just like real code. Learn direction, spacing, padding and resizing with practical examples.

Auto Layout: Responsive UI in Figma – Figma cover image

Key takeaways

  • Select layers and press Shift+A to wrap them in an auto layout frame.
  • Gap controls space between items and padding controls space inside the frame.
  • Hug contents, Fill container and Fixed decide how each frame and child resizes.
  • Nest auto layout frames to build whole cards, lists and pages that adapt to content.

Before auto layout, changing one button label in Figma meant resizing the button by hand, then nudging everything next to it. Auto layout fixes that. It turns a frame into a flexible container that arranges its children automatically, a lot like CSS Flexbox on the web. It is the foundation of every design system I build.

Step 1: Create your first auto layout

  1. Type a text layer, for example “Get started”.
  2. Select it and press Shift + A.
  3. Figma wraps it in a frame. Add a fill and corner radius, and you have a button.

Now edit the text. The button grows and shrinks with the label. That is auto layout working.

Step 2: Direction, gap and padding

In the Auto layout section of the right sidebar:

  • Direction: vertical, horizontal, or wrap. Wrap moves items to a new row when they run out of space, which is ideal for tag lists.
  • Gap between items: the space between each child.
  • Padding: space between the edge of the frame and its content. You can set each side separately.
  • Alignment: a 3×3 grid that controls where children sit.

Pro tip: Set the gap to Auto to push items to opposite ends, like a logo on the left and a menu on the right of a navbar.

Step 3: Understand resizing

Each frame and child has width and height settings:

SettingWhat it doesTypical use
Hug contentsShrinks to fit the contentButtons, chips, labels
Fill containerStretches to fill the parentInputs, full-width cards
FixedStays at an exact sizeIcons, avatars, images

You can also set min and max widths, so a card stretches on desktop but never becomes too wide to read.

Step 4: Nest auto layouts

Real interfaces are layouts inside layouts. A product card might be:

  1. A vertical auto layout card (image, text group, button).
  2. Inside it, a vertical text group (title, price).
  3. Inside that, a horizontal row (rating stars and review count).

Select a group of layers and press Shift + A at each level. When you change the title to two lines, everything below moves down automatically.

Step 5: Reorder with drag and arrow keys

Drag items inside an auto layout frame to reorder them, or select a child and use the arrow keys. Spacing stays perfect.

Watch out: If a child refuses to stretch, check both levels: the child needs Fill container and the parent must not be set to Hug in that direction.

Practice

Build a navbar: a horizontal auto layout with a logo, a nested horizontal group of four links with a 24 px gap, and a button. Set the main gap to Auto and the width to Fill. Resize the frame and watch the whole navbar adapt.

Frequently asked questions

When should I use Hug, Fill or Fixed?

Use Hug when a frame should wrap tightly around its content (like a button), Fill when a child should stretch to the space available (like a full-width input), and Fixed when you need an exact size.

Can an item ignore auto layout?

Yes. Select the child and turn on absolute position in the design panel. It keeps its position inside the frame without affecting the other items, which is useful for badges and notification dots.

Written by

Ain Ali

Ain Ali is an entrepreneur and professional graphic designer specialising in logo design, branding, website design, app design and UI/UX in Figma, and the founder of techngraphic.com.

More about Ain

Ask a question or leave a tip

Your email address will not be published.

Keep learning