All Guides
    How-To Guide
    Auto Layout

    How to fix spacing issues in Figma using Auto Layout

    By Nitin Khatri (Senior UI/UX Designer & Educator)
    Reviewed by Sarah Miller (Principal Product Designer (Reviewer))
    Updated
    Reading Time: 2 min
    Level: Beginner

    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

    1

    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.

    2

    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.

    3

    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.

    4

    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:

    Responsive App Navigation Bar

    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.

    Verification Screenshots checklist:
    • 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

    Hug Contents

    A sizing constraint instructing the container frame boundaries to fit around child layers automatically.

    Fill Container

    A responsive instruction that stretches child layers to consume the remaining horizontal space of its parent flex frame.

    Master Component

    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.

    Download Template