How to Enable and Use Auto Layout in Figma
In this article
To enable Auto Layout in Figma, select one or more objects, then press Shift+A (or click the Auto Layout button in the right sidebar). The selection becomes a frame that automatically arranges its children in a row or column, with controls for spacing, padding, alignment, and resizing. Auto Layout is essential for building responsive interfaces, buttons, lists, and cards that adapt to content changes without manual repositioning.
What You'll Need
- A Figma account (free or paid) and access to a file where you can edit.
- At least one object on the canvas (text, shape, image, or another frame) to apply Auto Layout to.
- Familiarity with the Figma interface: layers panel, canvas, and right sidebar. Labels may differ slightly by version, device, or region.
Step-by-Step
- Select the objects you want to arrange. Click and drag on the canvas to marquee-select multiple layers, or Shift-click layers in the Layers panel. You can also select a single object (e.g., a text layer) to wrap it in an Auto Layout frame.
- Apply Auto Layout. Press Shift+A on your keyboard, or click the + next to Auto layout in the right sidebar (under the Design tab). The selected objects become children of a new frame with Auto Layout applied.
- Choose direction. In the Auto Layout section of the right sidebar, click the Direction dropdown and select Horizontal (row) or Vertical (column). The default is often horizontal; change it to match your layout.
- Adjust spacing between items. Use the Gap between items field to set the distance between children. You can type a value or drag the handle on the canvas. For vertical layouts, this controls vertical spacing; for horizontal, horizontal spacing.
- Set padding. Use the padding fields (top, right, bottom, left) to add space inside the frame around its children. Click the individual icons or type values. You can also click the center icon to set uniform padding.
- Control alignment. Use the alignment buttons (nine-dot grid) to align children within the frame: left, center, right, top, middle, bottom. These affect how children are distributed when the frame is larger than its contents.
- Set resizing behavior. In the Auto Layout section, choose how the frame resizes: Hug contents (frame shrinks to fit children), Fixed width/height (frame stays a set size), or Fill container (frame expands to fill its parent). For children, use the Resizing dropdown to set Fixed, Hug, or Fill container.
- Reorder children. Drag layers in the Layers panel or on the canvas to change their order within the Auto Layout frame. The layout updates automatically.
- Nest Auto Layout frames. You can apply Auto Layout to a frame that is already inside another Auto Layout frame. This creates complex, responsive structures (e.g., a card with a horizontal header and vertical body).
- Test responsiveness. Resize the parent frame or change text content to see how Auto Layout adjusts spacing and sizing. Use the Preview mode (Play button) to interact with the design.
Common Mistakes
- Applying Auto Layout to a group instead of a frame. Auto Layout works on frames, not groups. If you select a group, Figma may convert it to a frame automatically, but it's better to start with a frame.
- Forgetting to set resizing behavior. Leaving children as Fixed when they should be Fill container causes overflow or misalignment when the frame resizes.
- Overlooking padding and gap. These are separate: gap is space between children; padding is space inside the frame edges. Mixing them up leads to uneven layouts.
- Not using constraints for non-Auto Layout frames. Auto Layout handles responsiveness internally, but parent frames without Auto Layout still rely on constraints. Combine both for full control.
- Ignoring alignment settings. The alignment grid affects distribution when the frame is larger than its contents; setting it wrong makes items appear off-center.
Tips
- Use keyboard shortcuts: Shift+A to add Auto Layout, Ctrl+Shift+G (Windows) or Cmd+Shift+G (Mac) to wrap in a frame, and Alt+A to remove Auto Layout.
- Name your Auto Layout frames descriptively (e.g., "Button/Default") to keep the Layers panel organized.
- Use Hug contents for buttons and tags so they resize with text; use Fill container for elements that should stretch, like input fields.
- Combine Auto Layout with Components to create reusable, responsive UI elements.
- Use the Spacing handle on the canvas to quickly adjust gap by dragging.
Troubleshooting
- Auto Layout option is grayed out: Ensure you have selected at least one object and that you are not in a restricted mode (e.g., viewing without edit access). Also, some object types (like certain vector networks) may not support Auto Layout directly; try wrapping them in a frame first.
- Children overlap or overflow: Check that the frame's resizing is set to Hug contents or that children are set to Fill container appropriately. Reduce fixed sizes or adjust gap/padding.
- Cannot reorder children: Make sure you are dragging within the Auto Layout frame's layer list, not the canvas. If dragging on canvas, hold Space to temporarily disable Auto Layout reordering.
- Unexpected spacing: Verify that padding and gap values are correct. Also check if any child has Fill container causing it to expand and push others.
- Auto Layout removed accidentally: Press Ctrl+Z (Windows) or Cmd+Z (Mac) to undo. Or reapply with Shift+A.
Frequently Asked Questions
Can I apply Auto Layout to a group?
No, Auto Layout applies to frames. If you select a group and press Shift+A, Figma will convert it to a frame with Auto Layout. It's often better to create a frame first.
How do I remove Auto Layout?
Select the Auto Layout frame, then click the minus icon next to "Auto layout" in the right sidebar, or press Alt+A (Windows) or Option+A (Mac). The frame remains but loses Auto Layout behavior.
What's the difference between gap and padding?
Gap is the space between child items. Padding is the space inside the frame's edges, around all children. Both are adjustable in the Auto Layout section.
Can I use Auto Layout inside another Auto Layout?
Yes, nesting Auto Layout frames is supported and common for complex layouts. Each frame has its own settings.
Why do my items not stretch to fill the frame?
Check the child's resizing setting: set it to "Fill container" to make it expand. Also ensure the parent frame has a fixed size or is set to fill its container.
Does Auto Layout work with text layers?
Yes, text layers can be children of Auto Layout frames. Set the text layer's resizing to "Hug contents" or "Fill container" to control how it behaves.