Figma Support Forum

Auto-Layout for Top Level Frames

Has anyone found a way to set up top-level frames so that they auto-resize in height (or width) based on the content in the artboard?

What’s the issue with them? Just add auto layout, like with all other frames. Top-level frames are not some kind of special frames where you can’t add auto layout.

1 Like

The issue arises when you are mixing fixed elements like app bars and nav bars with scrolling elements like the body of the screen. It doesn’t seem possible to mix fixed elements and scroll elements within a top-level frame with auto-layout set. Here’s my test file.

The first frame in the file has Auto-Layout applied, and yes it will grow and shrink in height based on the amount of text in the Body frame, but it’s not possible to fix the Header or Footer frames to the top and bottom of the screen respectively.
The second frame does not have Auto-Layout applied to the top-level frame and I’m not able to fix the Header and Footer frames. The Body frame has Auto-Layout applied and does grow & shrink in height depending on the amount of text, but has no effect on the height of the top-level frame on the canvas and cuts off the scrolled content when previewed if the Body frame is not completely visible on the Canvas.