Figma Advanced Prototyping
Auto Layout Basics
What Is Auto Layout?
Auto Layout is a powerful Figma feature that lets you create designs that automatically adjust as their content changes. Instead of manually resizing every element, you set the rules, and Figma handles the rest. Think of it like a smart container for your design elements.
It adds a layer of predictability to your designs. When you add more text to a button, the button grows with it. When you remove an item from a list, the other items close the gap.
This makes your components flexible and responsive, saving you countless hours of tedious adjustments. It’s the key to building complex interfaces that are easy to maintain.
Applying Auto Layout
Getting started is simple. You can apply Auto Layout to a group of selected layers or directly to a single frame or component. The quickest way is to select your elements and use the keyboard shortcut.
Shift + A
Once applied, Figma will wrap your selection in a new frame with Auto Layout properties enabled. You'll see these new controls appear in the right-hand design panel. This new frame now controls the arrangement of the items inside it.
The Control Panel
With an Auto Layout frame selected, the design panel gives you full control over how its children are arranged. Here are the core properties you'll use.
| Property | Description |
|---|---|
| Direction | Arranges items horizontally or vertically. You can also set it to 'wrap' for more complex layouts. |
| Spacing | Defines the exact gap between each item in the frame, either horizontally or vertically. |
| Padding | Controls the amount of empty space around the items, but inside the bounds of the frame. |
| Alignment | Aligns the items within the frame. For example, you can align them to the top-left, center, or bottom-right. |
Mastering these four properties is the key to building almost any responsive component you can imagine.
Building a Responsive Button
Let's build a simple button to see Auto Layout in action. Start with just a text layer, for example, "Submit".
- Select the text layer and press
Shift + A. It's now an Auto Layout frame. - In the design panel, add some horizontal and vertical padding. For example, 16px on the sides and 8px on the top and bottom. You'll see the frame expand around the text.
- Give the frame a fill color to make it look like a button.
That's it. Now, try changing the text from "Submit" to "Create New Account." The button will automatically resize to fit the new text perfectly, keeping the padding consistent.
Figma Auto Layout lets you create flexible UI components that adapt automatically to content changes, screen sizes, or user interactions.
Designing a Flexible Card
Cards are another common UI element that benefits greatly from Auto Layout. A typical card might include a title, a short description, and a button. You can build this by nesting Auto Layout frames.
- First, select the title and description text layers and apply Auto Layout (
Shift + A). Set their direction to vertical and adjust the spacing between them. - Next, group this new text frame with your button component. Select both and press
Shift + Aagain. Keep the direction vertical and set the spacing you want between the text block and the button. - Now you have a fully responsive content block. If the description text gets longer, the button will be pushed down automatically, and the card's height will adjust.
By combining and nesting these simple containers, you can build entire interfaces that reflow intelligently as content or screen sizes change.
What is the primary purpose of using Auto Layout in Figma?
What is the keyboard shortcut to apply Auto Layout to a selection in Figma?
With these basics, you're ready to start building more dynamic and maintainable designs.
