Back to Writing
Writing / UI/UX Design
UI/UX Design Figma Responsive Design November 2026 · 8 min read

How Auto Layout and Constraints Actually Work in Real Products.

Auto Layout and Constraints are more than Figma features. They are essential tools for designing interfaces that adapt to changing content, screen sizes, and real product requirements.

Shevin Nikesh
Shevin Nikesh UI/UX Designer & Product Developer · Sri Lanka
Published Nov 2026 Core Concept Guide
Figma Design System Architecture

From Static Artboards to Dynamic Interfaces

Bridging the gap between UI mockups and real-world frontend code through flexible layouts, content-driven containers, and screen boundary anchors.

↔ Direction & Gap ⌗ Hug vs Fill ⚓ Pinning Constraints
Auto Layout Frame Direction: Horizontal
Profile Card Component
Padding: 16px · Gap: 12px
Hug Contents
Fluid Search Field
Responds to parent viewport
Fill Container
Floating Action Trigger
Fixed Anchor: Bottom · Right
Constraints: Right/Bottom

# Introduction: Why Static Designs Are Not Enough

One of the biggest differences between designing a simple visual mockup and designing a real digital product is how the interface responds when something changes.

Imagine designing a mobile dashboard. A button looks perfect when its label is short. But what happens when the text becomes longer? What happens when a card contains more information? What happens when the same component needs to work on different screen sizes?

If every element has to be manually repositioned whenever content changes, the design becomes difficult to maintain.

This is where Figma Auto Layout and Constraints become essential.

They help designers create flexible interfaces instead of relying entirely on fixed positions and dimensions. Understanding these concepts is especially important for aspiring UI/UX designers, product designers, and anyone learning responsive interface design.

[Section 01]

1. Understanding the Difference Between Auto Layout and Constraints

Although Auto Layout and Constraints both help manage layouts, they solve completely different structural problems.

What is Auto Layout?

Auto Layout allows elements inside a frame or component to automatically arrange themselves based on their content, spacing, and layout direction.

For example, imagine a button containing an icon and a text label. Without Auto Layout, you manually reposition everything if the label changes. With Auto Layout, the button automatically adjusts its dimensions according to its content and padding.

Best used for:
  • Buttons and input fields
  • Navigation bars
  • Cards and content sections
  • Lists and repeated items
  • Forms and settings screens
  • Responsive page sections

What are Constraints?

Constraints define how an element behaves when its parent frame changes size.

For example, imagine a profile card with an avatar positioned on the left and a settings icon on the right. When the parent frame becomes wider, you want the avatar attached to the left and settings attached to the right. Constraints define that anchor relationship.

Common constraint options:
Left Right Left & Right Center Scale Top Bottom Top & Bottom
💡 The main idea: Design the relationship between elements, not just their individual positions.
[Section 02]

2. Auto Layout: The Foundation of Flexible Components

To use Auto Layout effectively, it is essential to master its three primary sizing behaviours:

Fixed Width and Height

Fixed sizing keeps an element at a defined dimension (e.g. an icon button locked at 44 × 44 pixels). Useful for consistency, but applying it everywhere makes a design rigid and brittle.

Fixed (e.g., 44px)

Hug Contents

Allows a frame to adjust its dimensions according to its internal children plus padding. If a button label changes from "Continue" to "Continue to Payment", it expands seamlessly. Perfect for badges, tags, and buttons.

Hug Contents

Fill Container

Enables an element to stretch and occupy all available space within its parent Auto Layout frame. For instance, a search field occupying whatever remaining width exists beside fixed action icons.

Fill Container

Why These Sizing Behaviours Matter

A practical interface rarely contains elements that all behave identically. A button might Hug Contents, an icon might use Fixed sizing, and a main content area might Fill Container. Good layout design comes from choosing the right behaviour for each individual layer.

[Section 03]

3. How to Use Auto Layout in Real UI Components

Let's explore three practical, production-level examples that illustrate these concepts in daily design work.

Example A: A Responsive Button

Horizontal Frame

A button typically contains a background container, a text label, an optional icon, and consistent horizontal and vertical padding. Instead of manually adjusting its width every time the label changes, create an Auto Layout frame:

Direction: Horizontal
Alignment: Center
Width: Hug
Height: Hug

Now, the button adapts effortlessly to short labels ("Save") or long translated copy ("Speichern und Fortfahren") without breaking padding or alignment.

Example B: A Dashboard Card

Vertical Frame

Imagine a step-tracking or analytics card displaying daily activity. It might contain a title, step count, visual progress bar, and supporting description.

The card uses a vertical Auto Layout frame. The title and description Hug Contents, while the card itself uses a defined width or Fill Container depending on its grid. When the count changes from a 3-digit number to a 5-digit number, the card dynamically adapts without needing manual redesign.

Example C: A Navigation Bar

Nested Frames

A navigation bar contains a logo, links list, and an action CTA. A top-level horizontal Auto Layout frame maintains overall spacing and alignment.

By nesting horizontal Auto Layout frames (one group for links, one for account actions), you can set the gap between groups to Space Between (Auto), guaranteeing that the logo pins to the left and CTAs pin to the right across any screen size.

[Section 04]

4. When Should You Use Constraints Instead?

Auto Layout is powerful, but it is not the solution to every layout challenge. Some elements must maintain an explicit relationship with the edges or center of their parent artboard.

Floating Action Button

Must remain anchored to the bottom-right corner when the mobile frame height changes. Constraint: Right + Bottom.

Modal Close Icon

Must stay pinned 16px from the top-right corner of a dialog popup regardless of modal size. Constraint: Right + Top.

Centered Branding

Maintains exact optical alignment with the center axis of a splash screen. Constraint: Center + Center.

[Section 05]

5. Auto Layout and Constraints Can Work Together

A common beginner mistake is assuming that designers must choose between either Auto Layout or Constraints for an entire interface. In reality, modern product design uses both simultaneously.

How They Synergize in a Product Dashboard:

  1. Internal Content: The card uses Auto Layout to manage its internal padding, icon gap, and label wrapping.
  2. Grid Placement: The card itself sits inside a responsive Auto Layout row that Fills Container.
  3. Global Anchors: A persistent bottom navigation bar uses Constraints (Bottom, Left & Right) to stay anchored to the device bezel.
  4. Fluidity: The entire interface expands or contracts without a single manually adjusted pixel.

The goal is not to use one feature everywhere. The goal is to choose the right layout behavior for each relationship.

[Section 06]

6. Common Mistakes Designers Should Avoid

Using Fixed Widths for Everything

Fixed dimensions cause text truncation and awkward empty spaces. Use Hug or Fill to let components breathe naturally.

Adding Auto Layout Without Understanding Structure

Randomly wrapping layers in Auto Layout without planned hierarchy creates bloated layer trees that confuse developers during handoff.

Ignoring Dynamic Text Behavior

Text wraps, internationalizes, and expands. Test your cards with 1 sentence, 3 sentences, and foreign languages to verify resilience.

Forgetting Responsive Breakpoints

A layout designed on a 1440px desktop frame must thoughtfully reflow on 390px mobile screens, not just shrink.

Treating Every Component as a Separate One-Off Design

A consistent product needs reusable tokens and components. Standardize padding and corner radii across your system.

[Section 07]

7. A Practical Learning Exercise

The 15-Minute Dashboard Stress Test:

If you are learning Figma Auto Layout, build a simple mobile screen with these 5 layers:

1. Welcome Header (Greeting + Avatar)
2. Daily Activity Summary Card
3. Two Side-by-Side Stat Cards
4. Primary Action Button
5. Bottom Navigation Bar

Stress Test Checklist:

  • Double the length of the primary button label — does padding hold?
  • Add three extra bullet points to the summary card — does the screen push down smoothly?
  • Widen the artboard from 375px to 430px — do cards fill the width cleanly?

Conclusion: Design for Behaviour, Not Just Appearance

Figma Auto Layout and Constraints are fundamental skills for modern UI/UX and product designers.

Auto Layout helps organise content and build flexible components. Constraints help define how elements behave when their parent frames change. When used thoughtfully, they make designs easier to maintain, more adaptable, and better prepared for developer handoff.

"A strong interface is not just a collection of well-positioned elements. It is a system of elements that work together."

— Shevin Nikesh

About the Author

Shevin Nikesh

Shevin Nikesh

Shevin Nikesh is a UI/UX Designer and AI-Augmented Web Developer from Sri Lanka, interested in creating thoughtful digital experiences and building practical products through design and technology.

Explore More Insights & Works