Skip to main content
April 1, 2026Dan Rodney/9 min read

Auto Layout: Deeper Dive

Master Advanced Auto Layout Techniques in Figma

Core Auto Layout Concepts

Nesting Auto Layouts

Learn to create complex responsive designs by combining multiple auto layout containers within each other.

Spacing & Padding Control

Master the difference between spacing and padding to create precise layouts with proper visual hierarchy.

Advanced Positioning

Understand absolute positioning and negative spacing to achieve sophisticated design layouts.

Topics Covered in This Figma Tutorial:

Master the advanced capabilities of Auto Layout through hands-on practice: Nesting Auto Layouts for complex hierarchies, Auto Layout Spacing & Padding for precise control, Auto Layout Sizing & Constraints for responsive design, Negative Spacing & Stacking Order for creative overlapping effects, and Absolute Positioning Elements for flexible component placement.

Exercise Preview

preview auto layout deepdive

File Setup Requirements

Ensure you have the Auto Layout.fig file located in Desktop > Class Files > Figma Class before beginning this exercise.

Exercise Overview

In this comprehensive exercise, you'll master the art of building sophisticated, responsive layouts using Figma's most powerful Auto Layout features. By the end of this tutorial, you'll understand how to create flexible design systems that adapt seamlessly to content changes while maintaining pixel-perfect control over spacing, alignment, and positioning. These skills are essential for modern UI/UX professionals working on scalable design systems.

Opening the File

Let's begin by accessing your practice file. Follow these platform-specific steps to ensure you're working with the correct starting materials.

  1. In Figma, navigate to the homescreen (file browser) using the appropriate method for your platform:

    • Desktop app: Click the home tab Home tab (Mac users can alternatively choose File > Open File Browser).
    • Web app: At the top left, click the Main menu button main menu and select Back to files.
  2. To import your local exercise file, click import file Import file (located near the top right of the interface).
  3. Navigate to Desktop > Class Files > Figma Class and double-click Auto Layout.fig to select it.

    After the file uploads successfully, click Done and double-click the file thumbnail to open it in the editor.

Adding Auto Layout

Now we'll begin structuring our product card with Auto Layout. This foundational step will enable all the advanced features we'll explore later.

  1. Select all elements on the Products Page except the navigation bar at the top. Use click-and-drag or hold Shift while clicking to multi-select.
  2. Ctrl+click (Mac) or Right-click (Windows) on any selected object and choose Add auto layout, or use the keyboard shortcut Shift+A.

    Don't be concerned that the layout appears disrupted—we'll fine-tune the arrangement in the following steps.

  3. The content is now contained within an Auto Layout frame. In the Layers panel, rename this Frame to product for better organization.
  4. Let's establish a clean background. With the frame selected, navigate to the Design panel and click the Plus (+) button next to Fill.

    • Ensure the fill color is set to white. This creates a clean foundation for our product card.
  5. In the Design panel, locate the corner radius Corner radius setting below the height (H) value and set it to 30. This adds modern, rounded corners to our card.
  6. The top corners may not appear rounded due to content overflow. Enable Clip content in the Design panel to ensure clean corner rendering.
  7. With the frame still selected, change Horizontal resizing from Hug to Fixed width (located below the width value).

    Professional Tip: Fixed width prevents internal content from dictating the container size, giving you precise control over the card's dimensions. This approach is crucial for maintaining consistent layouts in design systems.

Initial Auto Layout Setup

1

Select Elements

Select all items on the Products Page except the navbar at the top

2

Apply Auto Layout

Right-click and choose Add auto layout or use Shift-A shortcut

3

Configure Frame

Rename to 'product', add white background, set corner radius to 30, and enable clip content

Nested Auto Layout Tasks

0/4

Adding Auto Layout to the Content Inside

Next, we'll organize the internal elements with their own Auto Layout containers, creating a hierarchical structure that provides granular control over each component group.

  1. Select the three color circles by double-clicking into the frame, then selecting one circle and Shift-clicking the others to multi-select.
  2. Apply Auto Layout to these elements using Ctrl+click (Mac) or Right-click (Windows) and selecting Add auto layout, or press Shift+A.

    • In the Design panel's Auto layout section, click Horizontal direction horizontal direction to arrange the circles side by side.
    • Rename this frame to colors in the Layers panel for clarity.
  3. With the colors frame selected, hold Shift and click the Buy Now button to add it to your selection.
  4. Create another Auto Layout container using Ctrl+click (Mac) or Right-click (Windows) and selecting Add auto layout, or press Shift+A.

    • Set the layout direction to Horizontal horizontal direction in the Design panel.
    • Rename this frame to buttons group in the Layers panel.
  5. You'll notice the color circles aren't vertically aligned with the Buy Now button. Let's fix this alignment issue by selecting the center alignment option in the Design panel:

    center alignment

  6. Now we'll optimize the button group's layout behavior. In the Design panel:

    • Change Horizontal resizing from Hug to Fill container (located below width).
    • Click the ••• button next to Auto layout to access Advanced layout settings.
    • Change Spacing mode from Packed to Space between. This creates professional spacing that pushes elements to opposite ends of the container.
  7. Select both text elements: Distressed Denim Jacket and the description text below it.
  8. In the Design panel, change Horizontal resizing from Mixed to Fill container. This ensures the text utilizes the full available width for optimal readability.

Initial Auto Layout Setup

1

Select Elements

Select all items on the Products Page except the navbar at the top

2

Apply Auto Layout

Right-click and choose Add auto layout or use Shift-A shortcut

3

Configure Frame

Rename to 'product', add white background, set corner radius to 30, and enable clip content

Nested Auto Layout Tasks

0/4

Auto Width Spacing & Sizing

Now we'll create proper spacing and hierarchy by grouping content sections and applying strategic padding. This approach mimics professional design system practices used by leading tech companies.

  1. To add consistent spacing around content below the photo, we need to group these elements. Select all content below the image: both text elements and the buttons group frame.
  2. Apply Auto Layout using Ctrl+click (Mac) or Right-click (Windows) and selecting Add auto layout, or press Shift+A.

    • Rename this frame to info in the Layers panel.
    • Change Horizontal resizing from Hug to Fill container to ensure full-width utilization.
  3. Let's apply uniform padding for a polished appearance. In the Design panel under Auto layout, you'll see separate padding controls:

    • Hold Cmd (Mac) or Ctrl (Windows) and click the Horizontal padding icon horizontal padding. This merges both padding controls into a unified setting.
    • Enter 20 and press Return (Mac) or Enter (Windows) to apply consistent padding on all sides.
  4. You may notice the text elements and button group have reverted to fixed widths—a common occurrence when nesting Auto Layout containers. To restore proper behavior:

    • Select the two text elements and the buttons group.
    • Change Horizontal resizing from Fixed to Fill container in the Design panel.
    • The elements should now properly respect the container padding, creating balanced whitespace.
  5. Select the product photo.
  6. Change its Horizontal resizing from Fixed to Fill container. This ensures the image scales proportionally with the card container.

Unified Padding Shortcut

Hold Cmd (Mac) or CTRL (Windows) and click on Horizontal padding to merge both padding settings into one unified control.

Fill Container vs Fixed Width

Pros
Fill container adapts to parent frame changes
Creates responsive layouts automatically
Maintains consistent padding ratios
Cons
Fixed width can cause layout breaks
Elements may not resize as expected
Requires manual adjustment for responsiveness

Spacing Versus Padding

Understanding the distinction between spacing and padding is crucial for professional design work. Let's explore how each property affects layout behavior differently.

  1. Select the info frame (containing the text and buttons group).
  2. In the Design panel under Auto layout, set Spacing between items spacing between items to 7.

    Key Concept: This spacing applies uniformly between all child elements—the title text, description text, and buttons group. Auto Layout maintains this consistent spacing automatically, even when content changes.

  3. For more granular control, we'll add specific padding to create visual hierarchy. Select the buttons group frame using the Layers panel for precision.

  4. In the Design panel, click the Independent paddings button independent paddings at the bottom right of the Auto layout section. This unlocks individual padding controls.
  5. Set Top padding top padding to 15 and press Return (Mac) or Enter (Windows). This creates additional breathing room above the action elements, improving visual hierarchy.

Spacing vs Padding in Auto Layout

FeatureSpacingPadding
ApplicationBetween child elementsAround frame content
ConsistencyEqual for all gapsCan vary by side
Use CaseGeneral element separationTargeted spacing control
Recommended: Use spacing for uniform gaps, padding for specific positioning needs

Negative Spacing & Stacking Order

One of Auto Layout's most powerful features is the ability to create sophisticated overlapping effects while maintaining organized structure. This technique is commonly used in modern interface design for elements like avatars, badges, and layered components.

  1. Select the colors frame by double-clicking into the product container and referencing the Layers panel for accuracy.
  2. In the Design panel, locate Spacing between items spacing between items and experiment with the value by dragging left and right over the icon.

    • Observe how positive values create separation, while negative values produce overlapping effects.
    • Set the final value to -6 to create an elegant overlapping arrangement that suggests depth without compromising readability.
  3. To control which elements appear in front, we'll adjust the stacking order. Click the ••• button next to Auto layout to access Advanced layout settings.

    • Change Canvas stacking from Last on top to First on top. This ensures the leftmost circle appears in front, creating a natural left-to-right depth progression.
  4. Select the blue circle (currently positioned on the right).
  5. Press the Left Arrow key twice to reposition it to the far left. Notice how the stacking order automatically adjusts based on our earlier setting.

Advanced Spacing Techniques

Negative Spacing Effects

Negative values create overlapping elements, perfect for layered design effects like overlapping color swatches.

Stacking Order Control

Switch between 'Last on top' and 'First on top' to control which elements appear in front when overlapping.

Absolute Positioning Elements

The final piece of our advanced Auto Layout toolkit involves breaking elements out of the normal flow for precise positioning. This technique is essential for floating elements like badges, close buttons, or promotional labels that need to maintain fixed positions regardless of content changes.

  1. Ensure the product frame is selected as our positioning reference.
  2. We'll add a favorite heart icon to create an interactive element. In the top toolbar, click Resources resources.

    • Navigate to the Components tab in the panel that appears.
    • Click favorite to add the heart icon to your design.
  3. The heart icon initially appears at the bottom due to Auto Layout flow. To position it precisely, click the Absolute position button absolute position near the top right of the Design panel.

    • Drag the heart to the top right corner of the photo where it would naturally appear in a product interface.
    • In the Design panel under Constraints, change Left to Right. This ensures the heart maintains its distance from the right edge when the container resizes—crucial for responsive design.
  4. Select the product frame to test our responsive layout.
  5. Test the layout's flexibility by dragging the right edge of the frame (avoid the pink padding indicators). Observe the sophisticated behavior:

    • The heart icon maintains its top-right position regardless of container width.
    • The Buy Now button remains right-aligned while the color circles stay left-aligned.
    • Text reflows intelligently, adjusting line breaks and pushing other elements as needed.
    • All spacing and padding relationships remain proportionally consistent.
Constraint Configuration

When using absolute positioning, change constraints from Left to Right for elements that should stay anchored to the right side during resizing.

Dealing with Cropped Photos in Auto Layout

When working with images set to Crop mode (rather than Fill), resizing the parent container can cause unwanted distortion. For better control in these scenarios, consider setting the photo to Fixed width instead of Fill container. This approach allows you to manually adjust the image's width and positioning without compromising its aspect ratio—particularly important when working with product photography or portrait images that require specific cropping.

Photo Sizing Options

FeatureFill SettingFixed Width
Distortion RiskHigh when croppedNone
ResponsivenessAutomaticManual control
Best UseFlexible layoutsPrecise photo display
Recommended: Use Fixed width for cropped photos to prevent distortion

Fixed Position & Auto Layout

A key limitation to remember: when you apply Auto Layout to a parent frame, the Position: Fixed option becomes unavailable (grayed out) for child elements within that frame. This is by design, as fixed positioning conflicts with Auto Layout's content flow management. To work around this limitation, we recommend applying Auto Layout to specific element groups within a frame rather than to the top-level parent frame itself. This approach provides the benefits of Auto Layout while preserving the ability to use fixed positioning when necessary.

Auto Layout Limitation

Fixed positioning is disabled when auto layout is applied to a parent frame. Apply auto layout to child elements instead of the main frame to maintain fixed positioning capabilities.

Key Takeaways

1Auto layout works best when applied to child elements rather than parent frames to maintain positioning flexibility
2Use Fill container for responsive elements and Fixed width for elements that need consistent sizing
3Spacing controls gaps between elements uniformly, while padding allows for targeted spacing around specific sides
4Negative spacing creates overlapping effects, with stacking order controlling which elements appear on top
5Absolute positioning removes elements from auto layout flow while maintaining responsive constraints
6Cropped photos should use Fixed width sizing to prevent distortion during container resizing
7Nested auto layouts enable complex responsive designs by combining multiple layout containers
8Independent padding controls allow for precise spacing adjustments on individual sides of frames

RELATED ARTICLES