Embracing Constraints

Figma, obey me!

Magdalena Szymaniec
Mar 12 · 6 min read
Yo ho, auto layout life for me, yarr!

Intro

In this article, we’ll take a journey from a somewhat philosophical argument to the pure nerdy application of constraints and auto layouts in Figma to create complex yet obedient components and pages.

Buckle up, we’re going full UI

From constraint to infinity

What are constraints and how to use them?

The article by Figma explains that “(Constraints) allow you to fix elements of your design to different sides of their parent frame. If you set your constraints correctly, your design will scale to fit any screen size.” In layman’s terms, using constraints means giving the elements of your composition certain jobs to perform.

Sounds like a lot of options but in practice, they are quite intuitive
Fig 1: UI designer upon finishing a working card component

Enter the Auto Layout

Auto Layout can bring us to another level. It allows us to create complex structures of interdependencies one step at a time.

Looks like it works, right?
Auto layout allows us to design more and adjust less
  • Fixed Height/Width — means an object won’t resize with its parent or children, e.g. that “X” icon in the corner of your modal.
  • Fill Container makes an object stretch to fill its container. It can only be set on children of an Auto Layout frame. It ensures your object wraps correctly.
Auto Layout vs Regular Frame

Auto Layout or a frame?

So is Auto Layout the best, the one to go to, all hail the auto layout?
Not quite. Auto layout is great for reusable components, for design system elements, buttons, beautiful cards, etc. But it will not replace the ease of placing elements on a grid within a regular frame.

  • You can’t apply Constraints to any objects within an Auto layout frame (as discussed above).
You can’t expect your auto layout frames to be unbreakable

Back into the frame

Remember when I mentioned that auto layout frames do not have constraints like the regular frames? True, but when you place an auto layout frame within a regular frame, it behaves like any old element, with constraints and all bells and whistles. Note, that the UI gets a bit complicated with an option to pick simultaneously resizing options and “regular” constraints.

How to make a notification component with auto layout?

You can view the Figma file for this tutorial here.

How to make a table with auto layout?

You can view the Figma file for this tutorial here.

How to make a button that you can easily adjust between desktop and mobile viewports?

You can view the Figma file for this tutorial here.

How to make a complex card component?

You can view the Figma file for this tutorial here.

Homeday

HOMEDAY – The next generation estate agent.

Homeday

HOMEDAY is the next generation estate agent. Easier. Transparent. Digital. And cheaper. Because we believe: Good brokerage does not have to be expensive.

Magdalena Szymaniec

Written by

UI Designer at Homeday GmbH, Horse Rider & Illustrator, in no particular order.

Homeday

HOMEDAY is the next generation estate agent. Easier. Transparent. Digital. And cheaper. Because we believe: Good brokerage does not have to be expensive.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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