0
100
200
300
400
500
600
700
800
900
1000
1100
0
100
200
300
400
500
600
700
800
900
1000
1100
Guide · Auto layout & frames

How to Use Auto Layout in Figma

To use auto layout in Figma, select your layers and press Shift+A. Figma wraps them in an auto layout frame. Then pick a flow (Vertical, Horizontal or Grid), set the gap between items, the padding around them and the alignment, and decide how each child resizes: Fixed, Hug contents or Fill container.

After that, the frame arranges its children for you. Add a child, change some text or delete an item, and everything else moves to fit.

Updated Sep 24, 20265 min read
On this page
6 steps

Quick steps

1

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.

2

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.

3

Set the gap

Type a number for the space between items, or choose Auto spacing: Between, Evenly or Around.

4

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.

5

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.

6

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.

01

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.

02

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.

03

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.

04

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.

05

How to remove a gap or extra space

  1. 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.
  2. Padding: set the padding fields to 0, or check each side if you used per-side values.
  3. 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.
  4. A child set to Fill: it stretches into the free space. Change it to Fixed or Hug if it shouldn't.
06

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.

07

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.
08

Auto layout shortcuts

Add auto layoutMac⇧AWindowsShiftA
Remove auto layoutMac⌥⇧AWindowsAltShiftA
Suggest auto layoutMac⌃⇧AWindowsCtrlAltShiftA
Toggle text baseline alignmentMacBWindowsB

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 2026
FAQ

Frequently 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.

Keep learning

More in Auto layout & frames

All guides in Auto layout & frames