Resolving Unexpected Element Shrinking in Figma Auto Layout
Learn why your Figma elements suddenly shrink or collapse and how to fix layout logic conflicts between 'Hug' and 'Fill' constraints.
08 Jul 2025, 05:43 UTC

When building complex responsive design systems in Figma, elements often shrink to zero pixels or collapse unexpectedly despite having content inside them. This behavior is rarely a glitch; it is almost always a logic conflict within Figma's flexbox-like Auto Layout engine. When a child is told to fill a space that the parent is simultaneously trying to shrink around that child, the engine cannot determine a definitive dimension, resulting in a collapse.
The takeaway: to prevent shrinking, ensure the parent container has a defined dimension (Fixed or Fill) before a child is set to Fill container.
This guide assumes Figma's current Auto Layout model — Hug contents, Fill container, and Fixed sizing, plus min/max dimensions and absolute positioning. Panel labels can shift between releases, so verify names against your current UI.
Diagnostic Logic Table
Before diving into layers, identify the symptom to match it with the most likely structural error.
| Symptom | Likely Cause |
|---|---|
| Element is collapsed to 0px width | Child is 'Fill container' while the parent is 'Hug contents'. |
| Element overlaps others or ignores padding | 'Absolute position' is enabled, removing it from the layout flow. |
| Content is cut off despite having space | Min/Max constraints are more restrictive than the content size. |
| Layout breaks when the frame scales | Parent lacks a fixed width to support 'Fill' children. |
Step-by-Step Layout Audit
Follow these checks to isolate the layer hierarchy and find the constraint conflict.
1. Identify the Resizing Chain
Select the shrinking element and look at the Properties panel under the Frame section. Check the horizontal and vertical settings.
- If the element is set to
Fill container, select its immediate parent. - If the parent is set to
Hug contents, you have found a circular dependency. The parent is waiting for the child to define the size, but the child is waiting for the parent to provide the space.
2. Check for Absolute Positioning
If an element is visible but isn't pushing other elements out of the way, check whether the Absolute position toggle in the Auto Layout section of the right panel is active.
Absolutely positioned elements ignore the Auto Layout flow. They do not contribute to the parent's Hug contents calculations, which can cause parents to shrink as if those elements don't exist.
3. Inspect Min/Max Overrides
Sometimes an element is set to Fill, but a Min width or Max width has been applied. Open the width and height popover from the resizing controls in the right panel and check those fields. If the Max width is set smaller than the content, the element will appear shrunk regardless of the Fill setting.
Fixes Tied to Your Findings
Fix: Break the circular dependency
If you need the child to fill the space, the parent must have a boundary. You can achieve this in two ways:
- Change the parent's width from
Hug contentstoFixed width(a manual pixel value). - Change the parent's width to
Fill container, provided the parent's own ancestor also has a defined width. - Change the child from
Fill containertoHug contentsif you want the parent to grow with the text or image instead.
Fix: Reclaim absolutely positioned elements
If Absolute position was enabled by accident, select the child and switch it off. The element re-enters the flow, and the parent's Hug calculation accounts for it again. If the positioning was intentional — a floating badge, for example — keep it absolute but give the parent enough fixed padding or a minimum size so the surrounding layout reserves room for it.
Fix: Correct min/max overrides
Raise or remove a Max width that is smaller than the content. As a guardrail against future collapses, set a Min width on elements that must never shrink below a readable size; Figma will then refuse to size them below that bound even when other settings would squeeze them.
When to Restructure Instead of Patching
Some conflicts are symptoms of an ambiguous sizing contract rather than a one-off mistake. Escalate from instance-level fixes to structural changes when:
- The same Fill-in-Hug conflict recurs across many components. Document which level of the design system owns width — for example, top-level frames are Fixed, sections Fill, and cards Hug.
- A frame chain runs many Auto Layout levels deep. Every edit recalculates up the chain, and deeply nested layouts can slow large files noticeably in the browser.
- Changing a frame from Fixed to Fill breaks the whole layout. Trace upward from that frame until you reach the outermost frame with a defined width; that frame anchors the chain.
How to Confirm the Fix
- Select the previously collapsing element and confirm its width is non-zero and matches either its content or the available space.
- Drag the top-level frame wider and narrower. The element should resize smoothly without collapsing or overlapping its siblings.
- Replace the text content with a much longer string. A Hug parent should expand to fit it, and a Fill child should wrap or push the layout as intended.
- Walk the layer chain from child to outermost frame in the left panel, confirming each level's horizontal resizing setting. Every
Fillneeds aFixedorFillancestor somewhere above it.
Limitations: this guide covers width conflicts; the same logic applies to height in vertical Auto Layout. Figma evolves Auto Layout behavior between releases; if a result differs, verify against current official documentation.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.