On this page
Quick steps
Select the layers and add auto layout
Select a frame, a group, a component or any set of layers and press Shift+A. You can also click the button next to Auto layout in the right sidebar, or right-click and choose Add auto layout.
Choose a flow
Pick Vertical to stack items, Horizontal to put them in a row, or Grid for rows and columns. Horizontal can also wrap onto new lines.
Set the gap
Type a number for the space between items, or choose Auto spacing: Between, Evenly or Around.
Set the padding
Type one value for all sides, separate vertical and horizontal values, or a value per side. Cmd-click or Ctrl-click a padding field to type shorthand like 16,24,16,24.
Set the alignment
Click a position in the alignment grid to place children inside the frame. There are 9 options with a numeric gap and 3 with Auto gap.
Set how each layer resizes
In the Width and Height dropdowns, choose Fixed, Hug contents for the frame, or Fill container for children. Add min or max limits from the same dropdowns.
Vertical, Horizontal or Grid
Vertical stacks children top to bottom, like a list or a form. Horizontal lines them up in a row, like a button with an icon and a label or a nav bar. Horizontal also offers wrap, which moves items that don't fit to the next line and gives you separate gaps for items and rows. Grid is available on all plans and places children into rows and columns; it has its own guide at auto layout grid.
Nesting auto layout frames
Real components are auto layout frames inside auto layout frames. A card might be a Vertical frame holding an image, a text stack and a Horizontal button row, and each button is its own Horizontal frame with an icon and a label. Build from the inside out: make the smallest pieces first, press Shift+A on each, then select them together and press Shift+A again to wrap them in the next level. When the inner frames hug their content and the outer ones use Fill or Fixed widths, changing one label resizes the whole card correctly.
Auto layout space between items
The gap field takes a number, or one of three Auto spacing modes:
- Between (the default Auto mode): the first and last items sit at the edges, and the free space is shared between the items.
- Evenly: the edge space and the gaps are all the same size.
- Around: each gap is twice the size of the edge space.
If the content is too big to fit, the gap stops at 0. It doesn't go negative.
How to add padding in a Figma frame
Padding is the space between the frame's edge and its children. You can set it as one value for every side, as a vertical and a horizontal pair, or per side. The fastest way to type four different values is to Cmd-click (Mac) or Ctrl-click (Windows) a padding field and enter CSS-style shorthand: 16,24,16,24 for top, right, bottom and left.
A frame can never be smaller than its own padding. If you set 24px on the left and right, the frame is at least 48px wide, even with nothing in it.
How to remove a gap or extra space
- Gap: set the gap field to 0. If it's on Auto, switch back to a number first, because Between and Evenly spread items across any free space.
- Padding: set the padding fields to 0, or check each side if you used per-side values.
- Fixed size: a frame set to Fixed keeps its size even when the content is smaller, which leaves empty space. Switch its width or height to Hug contents.
- A child set to Fill: it stretches into the free space. Change it to Fixed or Hug if it shouldn't.
Resizing: Fixed, Hug contents and Fill container
Each layer has a width mode and a height mode. Fixed keeps a typed size. Hug contents makes an auto layout frame wrap its children. Fill container makes a child take the space its parent has left. Fill only exists on children of auto layout frames, and Hug only on auto layout frames themselves. If one of them is missing, Fill container vs Hug contents explains why.
Auto layout not working or options not showing
- Fill container isn't offered: the parent doesn't have auto layout, or the layer is a top-level frame.
- Wrap isn't offered: the frame isn't set to Horizontal. See auto layout wrap not working.
- You can't drag a child where you want it: auto layout positions children. Use Ignore auto layout to place one freely; see absolute position.
- Constraints disappeared: children of auto layout frames don't have constraints.
- Text doesn't line up: press B to toggle text baseline alignment.
Auto layout shortcuts
| Action | Mac | Windows |
|---|---|---|
| Add auto layout | Mac⇧A | WindowsShiftA |
| Remove auto layout | Mac⌥⇧A | WindowsAltShiftA |
| Suggest auto layout | Mac⌃⇧A | WindowsCtrlAltShiftA |
| Toggle text baseline alignment | MacB | WindowsB |
Suggest auto layout looks at a selection of loose layers and works out which ones belong in auto layout frames. It can create several nested frames at once, and Figma recommends running it in batches on complex designs. More keys are in the auto layout shortcut guide.
Ranked listThe best Figma plugins for renaming and cleaning up layers in 2026Frequently asked questions
What is auto layout in Figma?
Auto layout is a frame setting that arranges children for you in a row, a column or a grid, with a set gap, padding and alignment. When content changes, the frame and its children resize and move to fit.
How do I add padding to a frame in Figma?
Add auto layout with Shift+A, then type values in the padding fields in the right sidebar. Cmd-click or Ctrl-click a padding field to type all four sides at once, like 8,16,8,16.
How do I remove the gap in Figma auto layout?
Set the gap to 0. If the gap is set to Auto (Between, Evenly or Around), switch it back to a number first, because Auto spacing spreads items across the free space.
Why is my auto layout not working?
Check that the frame actually has auto layout, that the option you want matches the flow (wrap is Horizontal only), and that the child's sizing is right. Fill container only appears on children of auto layout frames.
More in Auto layout & frames
- How to Use Absolute Position and Z-Index in Figma Auto LayoutAbsolute position in Figma is Ignore auto layout. How to free one child to overlap others, change z-index with canvas stacking, and why you can't move a layer.
- Why Is Figma Auto Layout Wrap Not Working?Figma auto layout wrap not working? Wrap only exists in Horizontal flow, and a Fill container child never wraps without a min width. Here's how to fix both.
- Fill Container vs Hug Contents in Figma: Why Is One Missing?Fill container only shows on children of an auto layout frame, and Hug only on auto layout frames. How Fixed, Hug and Fill work, plus min and max width fixes.
- Frame vs Group in Figma: Which Should You Use?Figma frame vs group: groups take the size of their children, frames have their own size, clip content and auto layout. Shortcuts to group, frame and unframe.
- How to Use the Grid Flow in Figma Auto LayoutFigma's auto layout Grid flow puts children into rows and columns. How to set it up, size tracks, span cells, and how it differs from layout guides.
- What Is the Figma Auto Layout Shortcut?The Figma auto layout shortcut is Shift+A on Mac and Windows. Here are the keys to remove and suggest auto layout, plus what to do for Ignore auto layout.
- How to Make Figma Less Laggy and FasterFigma slow or laggy? Each file gets 2GB of memory. Check the memory meter, find heavy layers, and cut hidden layers, variants, big images and extra pages.
- How to install Figma pluginsFigma plugins don't need installing: open one from the Community or run it inside a file. Steps for Figma Design, Dev Mode, FigJam, Slides, saving and admins.
- Figma plugins not working? How to fix itFigma plugins not loading, missing or greyed out? Check your seat and edit access, org approval, network blocks and cache. A step-by-step checklist that works.
