· Working
Figma auto layout explained: Hug, Fill, Fixed and more
What every auto layout setting does, why layouts fall apart, how wrap and grid differ, and how each setting maps to CSS flexbox when the file reaches a developer.
Auto layout is a Figma frame setting that arranges child layers in a row, a column or a grid, with padding and gap values you control. When the content changes, the frame resizes itself. Most confusion comes from the three resizing modes, Hug, Fill and Fixed. Once those click, you can build almost any interface with it.
I'm Hai Le, a UI/UX designer who has built design systems for Car From Japan, Oreka and Joyme, and who writes the code for this portfolio myself. My 7-day Figma plan for beginners introduces auto layout on day three. This post goes further: what each setting does, why layouts seem to break on their own, and which line of CSS each setting becomes.
Feature names and shortcuts were checked against help.figma.com on October 4, 2026. If a control has moved, search for its name inside Figma.
How do you add or remove auto layout?
Select one or more layers and press Shift + A. Figma wraps them in a new auto layout frame, or turns auto layout on for the frame you selected. To remove it, press Option + Shift + A on Mac or Alt + Shift + A on Windows.
The right sidebar then gives you three flows:
| Flow | Arrangement | Good for |
|---|---|---|
| Vertical | Top to bottom | Forms, lists, single-column content |
| Horizontal | Left to right | Buttons with icons, nav bars, chip rows |
| Grid | Rows and columns | Galleries, dashboards, bento layouts |
Vertical and Horizontal also support Wrap. When children run out of room, they move to a new row (horizontal) or a new column (vertical).
What's the difference between Hug, Fill and Fixed?
Every layer in auto layout has one resizing mode for width and one for height, set independently.
| Mode | Behavior | Available on | Example |
|---|---|---|---|
| Hug contents | Shrinks to fit what's inside | Auto layout frames, text layers | Buttons, chips, badges |
| Fill container | Stretches into the parent's free space | Children of auto layout frames | Full-width form inputs |
| Fixed | Keeps the number you typed | Frames and children | 40px avatar, 24px icon |
The "Available on" column explains most of the confusion. Hug needs content to shrink around. Fill needs a parent to fill. A Fill child inside a Hug parent has nothing to stretch into.
The rule I work by: width flows from the outside in, height flows from the inside out. The outermost screen or column is Fixed. Blocks inside it Fill the width. Heights are almost always Hug, so longer text makes the block taller.
Text deserves a special mention. Figma warns that fixed-size text layers won't resize to fit their text, which can make them overlap other layers in an auto layout frame. For a paragraph inside a card, set width to Fill and height to Hug so the text wraps.
When should you use padding, gap and auto gap?
Padding is the space between the frame's edge and its content. Gap is the space between children. You can type a number, or, for vertical and horizontal flows, set gap to Auto and choose Between, Around or Evenly.
I use numeric gaps nearly everywhere and save Auto for cases where items should pin to both ends. A header with a logo on the left and a menu on the right is a horizontal frame, width Fill, gap Auto with Between.
Pull padding and gap values from a fixed scale, such as multiples of 4. Once that scale lives in variables, one change updates the whole file. What design tokens are covers how to name and organize that scale.
Wrap or grid: which one fits?
Both put children on more than one line. They treat columns differently.
| Wrap | Grid | |
|---|---|---|
| Columns line up | No, each row lays out on its own | Yes, by column count |
| Items of different widths | Works well | Awkward unless items span cells |
| Spanning cells | Not available | Column span and Row span |
| Spacing | Regular gap | Separate Gap between rows and Gap between columns |
| Use it for | Tag rows, filter chips, multi-column checkbox lists | Product grids, dashboards, bento layouts |
For grid, set Number of columns and Number of rows from the grid picker in the right sidebar. Rows default to auto, so the grid adds rows as you add items. Each track can be Fixed, Hug or Fill, and Fill uses fr units, just like CSS grid.
How do you overlap something without breaking the layout?
Use Ignore auto layout, which Figma used to call absolute position. The name changed and the behavior didn't. Select the child and click Ignore auto layout in the right sidebar, or on Mac hold Control while dragging a layer into an auto layout frame.
The layer stays inside the frame, but it and its siblings ignore each other as they resize. I use it for notification dots on avatars, close buttons in popup corners and "New" labels on card images.
If you find yourself reaching for it on more than one or two layers in the same frame, the frame structure is the real problem.
What are min and max width for?
The Width and Height dropdowns in the right sidebar include Add min width, Add max width, Add min height and Add max height. They limit how far Hug and Fill can stretch or shrink.
Two places I always set them:
- Max width on body text. On a wide desktop frame, very long lines make it hard to find the start of the next one. A max width keeps the measure readable.
- Min width on buttons. An "OK" button set to Hug is too small to hit comfortably. A min width keeps a usable size while still letting longer labels grow.
Clear them with Remove min and max in the same dropdown.
Why does my auto layout keep breaking?
These are the problems I see most often when reviewing beginners' files:
| Symptom | Cause | Fix |
|---|---|---|
| Fill is on, but the layer won't stretch | Parent frame is set to Hug | Set the parent to Fixed or Fill |
| Widening the screen leaves the form behind | Inputs are Fixed width | Set input width to Fill |
| Text overlaps the layer below | Text layer has a fixed height | Width Fill, height Hug |
| Uneven spacing between blocks | Empty rectangles used as spacers | Delete them, use gap or padding |
| Five or six unnamed nested frames | Shift + A pressed on every pair of layers | Frame by content block and name frames by role |
| One layer has to stay pinned to a corner | Position nudged by hand | Turn on Ignore auto layout for that layer only |
What works for me: sketch the layer tree in plain text first, then apply Shift + A from the innermost block outwards. Each frame should answer two questions: which direction, and how far apart.
Example: structuring an inquiry popup
At Car From Japan I cut the vehicle inquiry popup down to a "Check availability" title, one line of car details, four contact fields (name, email and phone required, address optional), an "Add a coupon" button and a prefilled message. The reasoning behind each change is in the inquiry form case study.
If I rebuilt that popup with auto layout, I would frame it like this:
Popup Vertical · Fixed width · Hug height · padding 24 · gap 16
├─ Header Horizontal · Fill width · gap Auto (Between)
│ ├─ Title Fill width
│ └─ Close Fixed 24 × 24
├─ Car Horizontal · Fill width · gap 12
│ ├─ Thumbnail Fixed
│ └─ Name+price Vertical · Fill width · Hug height
├─ Contact Vertical · Fill width · gap 12 (each field Fill width)
├─ Add a coupon Hug
└─ Submit Fill width · Hug heightA long car name only makes the Car row taller, and everything below moves down. Widen the popup and the fields and submit button widen with it.
How does auto layout map to CSS?
Auto layout maps to flexbox almost one to one. That's why I tell designers who want to learn code to start here.
| Figma | CSS |
|---|---|
| Vertical / Horizontal | display: flex with flex-direction: column / row |
| Gap | gap |
| Padding | padding |
| Auto gap: Between / Around / Evenly | justify-content: space-between / space-around / space-evenly |
| Wrap | flex-wrap: wrap |
| Hug contents | No explicit size, the element sizes to its content |
| Fill container (main axis) | flex: 1 |
| Fill container (cross axis) | align-self: stretch |
| Fixed | A numeric width / height |
| Min / max width | min-width / max-width |
| Grid | display: grid with grid-template-columns |
| Ignore auto layout | position: absolute inside a position: relative parent |
The popup header above, in CSS:
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
}Clean auto layout also pays off with AI tools. When Claude Code reads a file through the Figma MCP server, well-structured frames give it far less to guess. Figma MCP with Claude Code walks through that setup, and Claude Code for designers covers writing the code yourself.
What should you learn after auto layout?
Turn the blocks you built into reusable pieces with components and variants. I cover that in Figma components and variants.
If you're hiring a designer who builds design systems and can talk to developers in CSS, my about page has my experience and contact details.
Sources
Checked October 4, 2026.
- Guide to auto layout, Figma Help Center
- Use the grid auto layout flow, Figma Help Center
- CSS flexible box layout, MDN Web Docs
Frequently asked questions
- What is the shortcut for auto layout in Figma?
- Select one or more layers and press Shift + A. To remove auto layout from a frame, press Option + Shift + A on Mac or Alt + Shift + A on Windows.
- Why doesn't Fill container make my layer stretch?
- Fill container only works on a child of an auto layout frame. If the parent frame is set to Hug contents, it shrinks to fit its children, so there is no spare space to fill. Set the parent to Fixed or Fill and try again.
- Where did absolute position go in Figma auto layout?
- Figma renamed it Ignore auto layout. It works the same way. Select a child of an auto layout frame and click Ignore auto layout in the right sidebar. The layer stays inside the frame but drops out of the flow.
- Should I use wrap or grid for a list of cards?
- Use wrap when items have different widths and should simply break onto a new line, such as tags or filter chips. Use grid when columns must line up, the column count is fixed, or some items need to span several cells, as in a dashboard or bento layout.
- Is Figma auto layout the same as CSS flexbox?
- Close enough that a clean auto layout frame usually translates to flexbox almost one to one. Direction, padding, gap, wrap and the resizing modes all have CSS equivalents. The grid flow corresponds to CSS grid.
You might also like
What is Claude Code? Install it and run your first session, no coding needed
A designer's walkthrough for people who have never opened a terminal: what Claude Code is, what you need, installing on macOS and Windows, a safe first session, and fixes for the usual errors. Every command comes from Anthropic's docs.
Working· 2026-10-04
Claude Code for designers: turning a Figma design into a working page
How I use Claude Code as a designer to get from Figma frames to a real, maintained website: what to set up, how to write rules the agent follows, a six-step workflow, and the mistakes I made building this site.
Working· 2026-10-04
What is Claude? A guide for people who have never used AI
Claude is Anthropic's AI assistant. This guide covers what it can do, how the free and paid plans differ, how to run your first conversation, and where Claude tends to get things wrong. Every feature and price was checked against Anthropic's own pages.
Working· 2026-10-04