Free · 8 min read
Auto Layout in Figma: how it works and how to use it
How Auto Layout works in Figma: direction, gap, padding, alignment, Hug contents and Fill container, nested frames and Grid. Five exercises for beginners.
- How Hug contents differs from Fill container
- How to build a button, a card and a whole screen with auto layout
- Why layouts fall apart and how to fix them
- Free
- 1,504 members
- Join in 1 click
Five exercises to understand Auto Layout
- 1
Exercise 1
A button that grows with its text
- 2
Exercise 2
Direction, gap and alignment
- 3
Exercise 3
Hug contents, Fill container and Fixed
- 4
Exercise 4
Nested auto layouts, Wrap and Grid
- 5
Exercise 5
Stretch the screen and fix what breaks
- 1,504
- community members
- 8,915
- messages with questions since July 2024
- 9
- design games since September 2024
- 759
- people wrote in the chat
This guide is for you if you
Place everything by hand
Every text change means moving ten more elements, and the spacing is different each time.
Have already pressed Shift + A
Auto layout is on, but elements jump, stretch or shrink in ways you didn't intend.
Make responsive layouts
You want to stretch a screen from phone to desktop without rearranging things by hand.
In short
- Auto layout arranges a frame's elements in a row, a column or a grid, and rearranges them when the content changes.
- The key settings are direction, gap (space between elements), padding (space from the edge) and alignment.
- Each element's size is set by one of three options: Hug contents, Fill container or Fixed.
- Complex screens are built from nested auto layouts: a row inside a column, a column inside a grid.
- The best test is to resize the frame. If nothing breaks, the auto layout is done right.
Five exercises to understand Auto Layout
- 1
Exercise 1
A button that grows with its text
Type "Book now", select it and press Shift + A or Add auto layout in the right sidebar. Figma wraps the text in an auto layout frame. Add a fill and corner radius, and set the padding (the space between the frame's edge and its content), for example 12 px top and bottom and 24 px on the sides. Now change the text to "Book a consultation": the button should widen on its own.
- remove auto layout: Option + Shift + A (Mac) or Alt + Shift + A (Windows);
- padding can be the same on all sides, separate for vertical and horizontal, or different for each side;
- the padding field accepts CSS-style shorthand: "12, 24, 12, 24" sets top, right, bottom and left.
- 2
Exercise 2
Direction, gap and alignment
Add an icon to the left of the button text. Now the frame has two elements, and three more settings matter. Direction (flow): Horizontal puts elements in a row, Vertical in a column, Grid in rows and columns. Gap is the space between elements: a number, such as 8 px, or Auto, which spreads elements across the available space. Alignment is set for the whole frame in the nine-position box in the right sidebar.
- Auto gap has Between, Evenly and Around options, matching space-between, space-evenly and space-around in CSS;
- click the alignment box and use the arrow keys; W, A, S and D push the content to an edge;
- in horizontal and vertical auto layout you can't align a single element, only the frame's whole content (in Grid an element can be aligned within its cell).
💡 Exercise: build an app top bar with a back button, a title and a menu icon. Set Gap to Auto: if the button and the icon are the same width, the title lands in the middle without any manual math.
Auto layout fell apart? Show it
Often one fresh look is enough to spot that one Fixed that should be Fill. Post your frame in the community and people will point to the exact spot. It's free.
Get feedback on my layoutFree. 1,504 designers are already in the community.
- 3
Exercise 3
Hug contents, Fill container and Fixed
This is the setting behind most layouts that fall apart. For each element you choose a behavior separately for width and height:
- Hug contents: the frame wraps its content and changes with it; available only for auto layout frames;
- Fill container: the element fills all available space in its parent; available only for children of auto layout frames;
- Fixed: the size stays the same, whatever happens around it;
- Min / Max width and height: limits, for example a button no narrower than 120 px.
💡 Exercise: make a 320 px wide product card (Fixed) with a photo, name, price and button. Set the name and button to Fill container in width. Change the card's width: everything inside should adapt. Double-clicking an edge of the selection box sets Hug contents; with Option / Alt it sets Fill container.
- 4
Exercise 4
Nested auto layouts, Wrap and Grid
The real power of auto layout is nesting: each frame has its own direction, gap and padding. A screen is usually a vertical auto layout holding horizontal rows, cards and lists. Build a catalog page this way: a top bar, a row of filters and a list of cards.
- for a row of filter pills, turn on Wrap: elements that don't fit move to a new row;
- for a card grid, try the Grid direction: set the number of columns and rows, and cards can span several cells;
- for a "-20%" badge in the corner of a photo, turn on Ignore auto layout: the element stays in the frame but is excluded from the layout, and constraints work for it again.
💡 Grid in auto layout and a layout guide are different things: the first actually arranges content, the second is only visual guides for alignment.
Auto layout acting strange again? Ask the community → - 5
Exercise 5
Stretch the screen and fix what breaks
Take the catalog screen from the previous exercise and change the frame width from 375 px to 768 px, then to 1280 px. Watch what happens and fix it:
- text overflows or overlaps: the text layer probably has a fixed size; Figma advises against fixed-size text boxes in auto layout;
- cards don't stretch: check Fill container on them and on their parent frame;
- a button spans the full desktop width: give it a Max width;
- you can't reorder or add layers in a component instance: that's done only in the main component, and deleting in an instance only hides the layer.
💡 For practice, grab the official Auto layout playground file from Figma Community. Then share your screen in the community and ask: "What happens if the product name runs to three lines?"
You're not alone with these questions
We counted what people ask about most in our community. Learning, portfolios and Figma are the top three.
Messages by topic in Spaceberry Community, July 2024 — November 2026. Keyword search.
Practice with a deadline and live feedback
The best teacher is a task with a deadline that other people see. That's why the community regularly runs design games: the same brief for everyone, a deadline and a vote.

Design game · January 2026
NAOMA website redesign
The academy's home page through the eyes of an applicant, a student and a teacher. Three finalists; the community chose the winner.

AI challenge · May 2025
A landing page made by AI
Logo, copy and visuals made only with AI tools. Four entries, an anonymous vote, and participants shared their prompts.

Workshop · April 2026
Figmosha: AI in Figma
The tool's author showed how to generate interfaces in Figma and analyze a design system.
Free. 1,504 designers are already in the community.
How to join: 1 minute
- 1
Tap the button
Telegram opens with the Spaceberry community.
- 2
Join
It's free: all you need is a Telegram account.
- 3
Introduce yourself
Say where you're starting from and ask your first question.
Questions and answers
Didn't find your answer? Ask it in the community.
How is Auto Layout different from constraints?
Constraints define how an element behaves relative to the edges of a regular frame when that frame is resized: sticking to the left edge, staying centered or stretching. Auto layout arranges elements relative to each other and adapts to content. Constraints don't apply to children of an auto layout frame unless they have Ignore auto layout turned on.
Why does my auto layout fall apart?
Usually because of sizing: somewhere there's Fixed instead of Fill container or Hug contents, a text layer has a fixed width, or a parent frame hugs its content when it should fill space. Select elements one by one from the inside out and check width and height in the right sidebar.
Is Auto Layout available on the free plan?
Yes. According to Figma's help center, auto layout is available on all plans, including the free Starter plan; you only need edit access to the file. So you can do all five exercises in this guide for free. The official Auto layout playground file in Figma Community is handy for practice, and you can share the result in the community.
Is Figma Auto Layout the same as CSS Flexbox?
Not the same, but close. The horizontal and vertical directions work very much like CSS Flexbox, and Figma directly compares its Auto gap options to space-between, space-evenly and space-around. That makes such designs easier for developers to build, and easier for you to predict how a screen will behave in the browser.
Is the Spaceberry community paid?
No. Spaceberry Community is free: it's supported by Spaceberry Foundation, a non-profit public organization. All you need to join is a Telegram account. The community has 1,504 designers, and Figma is among its top three topics. People share files, help spot that stray Fixed and take part in design games with the same brief and a deadline. Most conversations are in Ukrainian.
Get feedback on your auto layout screen
Join 1,504 designers who learn, share their work and play design games. Show your screen and find out whether it survives long texts. The community talks in Ukrainian.
- Free
- 1,504 members
- Join in 1 click
Updated · Spaceberry Foundation
Sources: