Figma: Learn Auto-Layout

Figma recently released a new feature: Auto-Layout. This feature helps you to create resizable components easily. Let’s learn it together.

We (designers) are all having a problem with manually resizing our design content. Imagine you created a new button which has a label text on it: Sample text. Now, you want to change its label to “Click here” but the size of the button is not correct and you need to change its size manually.

Thanks to the team behind of Figma, the most awaiting feature of this design tool was released last week: Auto-Layout. Auto Layout allows you to create dynamic Frames that respond to their contents.

There are lots of ways you can use the Auto Layout:

  • Create buttons that grow or shrink as you edit the text label
  • Quickly build lists that adapt to new items
  • Combine Auto Layout Frames to build complete interfaces
  • Add Auto Layout to existing Components

Now, we’re going to create 3 different screens to see the “Auto Layout” feature in action. Before this article, I suggest you read this article: Everything about resizable components. Before we start, please download a Figma file which contains the designs (We will need it for 2–3 screens).

Before we start, I need to remind you: You need a frame to use “Auto Layout” feature.

Download the designs file

1- Create a resizable button

Let’s start with the simplest one: a resizable button. To have a short article, I will focus on the most important sections about “Auto Layout” feature:

1- Create a black button and put a label to it: “Label Text”. We just used a rectangle and text.

2- Now, change its position to make sure the button will be always at the centre of the button.

3- If you change the label text from “Label text” to something longer like “Add to your friends”, you see the problem.

4- We’re going to fix this issue. Auto Layout only works for frames, it means you can’t create a group and expect to see the “Auto Layout” section. So, you need to convert the group into a frame.

Now, Let’s do this:

5- Now, we converted the group into a resizable frame and you can see the Auto Layout section in the “Design” panel. If you check the “Auto Layout” section, you will see 5 different options:

Before I explain how each options works, please try to understand their use in the examples.

A: How do you want to sort the child layers

The first one has two options: Vertical and Horizontal. This will help you to sort the content of your frame vertically or horizontally.

For example, we have a frame like this:

Watch the below .gif to understand how it works in action:

B: Resize Automatically or Manually.

This option allows you to change the width or height of your frame manually or resize it automatically. For example, if your component size increases vertically, by using this feature you can only change its width manually.

Why can’t we change its height automatically? Auto Layout changes it automatically based on the options you’ve selected and the number of the child layers.

Watch the below .gif to understand it better:

C: Horizontal Padding

This options, define the space between child layers to the right side and the left side of your component.

Watch the below .gif to understand how it works in action:

D: Vertical Padding

This options, define the space between child layers to the top and the bottom of your component.

Watch the below .gif to understand how it works in action:

E: The space between items

As the title suggests, by changing its value you can define the space between the items (Child layers) of your frame.

Let’s see how it works in action:

6- Now, we want to add put an icon next to the label text (Forget the icon you’ve already seen in Step 5!) and sort the items vertically and see how these options work together:

7- Now, let’s compare it to the situation when Figma didn’t provide “Auto Layout”:

2- Create a resizable card

As I already said, let’s keep this article short (Please use the file at the beginning of this article). We’re going to make this card (or whatever you call it) resizable. So, please follow these steps:

1- As you see we have a frame which contains 6 elements (Image + Overline + Headline + Body text + Share icon + Button Label). In the first look, you think you just need to enable the “Auto Layout” feature for the frame but the result is very different than you think! Let’s try and see what happens:

Do you see? The result looks terrible! Let’s fix it. Don’t forget to press Command and Z before you check the other steps to undo what you did!

2- When you want to make a complex component “Resizable” like this card, you need to think about the hidden vertical and horizontal rows (If you want to resize it vertically, think about horizontal rows, otherwise think about vertical rows).

In this case, We have an image, the overline text, the headline text, the body text and finally, the share button (Share icon + Button Label). So, we need to think about 5 horizontal rows.

Since we need to make the share button resizable too, we need to put the share icon and button label into a group and convert it to a frame. By doing this, we decreased the number of elements from 6 to 5!

3- We still don’t want to make the whole frame resizable! Now, let’s go back to the share button. As you know, the share button is resizable but its label is not resizable. Let’s make it resizable by converting its text into a frame! Also, change the text from “Button” to “Share This Article”.

Now when you resize it, the size of the text frame changes automatically based on the text you’ve entered. Also, you can change the colour of the icon and text to blue to make them understandable as a button.

4- Now convert each of other texts (Overline + Headline + Body text) into a separate text. Don’t forget to set their “Horizontal Padding” to 5 px and change their “Vertical Padding” to 0! I will explain later why we need it!

5- Since we were going to design a resizable card, we need to make the whole frame (which contains the elements) resizable and turn the Auto Layout feature on for this frame.

A: Convert the “Content” into a frame and add the “Auto Layout” feature to this frame.

B: Make the “Body Text” left-aligned. Change the horizontal padding of the texts to 10 (I decided to increase it!).

C: Set the Horizontal Padding of the “Share Button” to 10 and its Vertical Padding to 10.

D: You can change the space between elements manually (In this example, I did set it to 15.

  • ** Important! DON’T USE A NUMBER OTHER THAN 0 FOR THE Horizontal Padding of the WHOLE FRAME. Why? Because we have an image and if you change the horizontal Padding of the whole frame, it won’t reach to the edge of the card.
  • ** Important! Thanks to the product designers of Figma, you can sort the layers easily by pressing the “Up” and “Down” keys.

6- Now, use some real data to see the magic of the Figma:

3- Re-create a Messenger

I saw this one when Figma introduced “Auto Layout”. Now, we’re going to make the bubbles of a messaging app resizable based on their content.

Bear that in mind in Figma, you can’t enable Auto Layout feature for custom shapes! So, the shapes you can make them resizable must be simple.

Use the third frame (You’ve downloaded a file! Don’t you remember?) and let’s make the conversation bubbles resizable.

1- We want to make the bubbles resizable. Before that, we must consider the hidden horizontal rows. The navigation bar (Which contains the Status bar and the navigation bar), the date, the first blue bubble, the second blue bubble, the seen time, the first grey bubble and the second grey bubble.

We have 7 rows but we don’t need it! Let’s decrease the number of rows by grouping similar items. Let’s create a group for blue bubbles (the first blue bubble, the second blue bubble, the seen time) and another group for grey bubbles. Now we only have 4 groups.

2- Convert each bubble into a frame and enable the Auto Layout for them:

3- Enable auto layout for the Blue group (the first blue bubble, the second blue bubble, the seen time) and Grey Group (the grey bubbles).

Now, if you change the content of the bubbles, you see the size of the bubbles will change based on the text length.

4- To improve what we created together, let’s create another group by merging the Blue and Grey groups. Nothing happened because if you enter a lengthy text in the blue bubbles, the grey bubbles wouldn’t move.

To fix this issue, change the order of layers from “Horizontal” to “Vertical”. Then, select “Fixed Height”.

Finally, Change the order of the child groups (Blue bubbles should sit above the Grey bubbles) and make the blue bubbles “Right Aligned” and the grey bubbles “Left-Aligned”.

5- To improve what we created in this section, lets’ enter a lengthy text in the bubbles and see what happens. Do you see? Their position is not correct! Do you remember we used a group for the grey bubbles? Pick the third bubble and make it left-aligned and do this for the fourth bubble too.

Pick the second bubble and make it right-aligned and do this for the first bubble too.

6- Let’s try again to see if the result is good or not!

Please share this article with others if you find it useful. Also, please check my portfolio:

Em Portfolio

A passionate designer who designs digital experiences for mobile phones and websites. — — — — — — — — — — — — — PORTFOLIO:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store