How to fix spacing issues in Figma using Auto Layout
Introduction
Even with Auto Layout, spacing can sometimes behave unexpectedly. Elements might be too far apart, or the padding might not look right on different screen sizes.
This guide covers the key settings to verify when your spacing looks off and how to refine it for pixel-perfect implementation.
Prerequisites
- •An existing Auto Layout frame
- •Selection of multiple objects
Guide Steps
Verify the gap value
Select the Auto Layout frame. Look at the 'Gap between items' field in the sidebar. Ensure this value is consistent (e.g., using an 8pt grid system). If individual items need different spacing, consider grouping them into a nested Auto Layout frame.
Switch distribution mode
Click the alignment box in the Auto Layout panel. Toggle between 'Packed' (items stick together with a set gap) and 'Space between' (items push to the edges). Use 'Space between' for flexible navigation bars or headers.
Standardize padding
Check the horizontal and vertical padding fields. You can also click the 'Individual padding' icon to set different values for Top, Right, Bottom, and Left if visible alignment is off.
Adjust canvas stacking order
If you are using negative spacing for overlapping avatars, click the three dots (...) in the Auto Layout panel and change the 'Canvas stacking' order to either 'First on top' or 'Last on top' to fix visual overlap.
Common Mistakes to Avoid
- ×Using 'Space between' when you actually want fixed spacing.
- ×Forgetting to check individual side padding values.
- ×Not using nested frames to group items that need closer spacing.
Pro-Level Design Tips & Workflows
💡 Canvas Shortcut: Select any parent Auto Layout frame and double-click the inner padding lines directly on the canvas to set sizing values visually without clicking the sidebar.
💡 Spacing Variables: Always bind padding and gap spacings to dynamic variables (e.g. space/8 or space/16) to support system theming scaling.
Practical UI Example & Screenshot Checklist
Here is a real-world scenario where you will apply these exact layout rules:
Build a container frame with a logo and menu links. Set Auto Layout horizontal direction, padding margins to 24px, and select 'Space between' alignment to keep elements pinned to the margins.
- ✓ Inspect the right-hand design variables sidebar.
- ✓ Verify child width dropdown is set to
Fill container. - ✓ Drag the parent frame width to verify elements adapt automatically.
Glossary of Core Design Terms
A sizing constraint instructing the container frame boundaries to fit around child layers automatically.
A responsive instruction that stretches child layers to consume the remaining horizontal space of its parent flex frame.
The primary component template source. Updates to the master component propagate across all visual instances.
Figma Templates & Resources
Figma Starter Playground (.fig)
Includes pre-built design grids, responsive card examples, and button variant frames.