Figma Auto Layout: Practical tips for dynamic designs

栏目: IT技术 · 发布时间: 4年前

内容简介:In the ideal world, everyone would just design websites from scratch directly inCheck out theTines case study to see how we helped a major security platform to achieve the full UX revamp.But even if you imagine that all designers on Earth learned their HTM

Go beyond pixel pushing and start speaking the same language as your engineering team by harnessing the power of Figma Auto Layout in your UI mockups. Learn how we use it to implement universal dynamic component systems—from design to code. See how Auto Layout allowed us to rethink the way we create interfaces for our clients and internal projects.

In the ideal world, everyone would just design websites from scratch directly in code . Modern browsers give us perfect tools to inspect, tweak, and test our components with instant visual feedback.

Designing with Chrome Inspector ️‍♀️

Check out theTines case study to see how we helped a major security platform to achieve the full UX revamp.

But even if you imagine that all designers on Earth learned their HTML, CSS, and JavaScript, the ideal won’t be reached anyways. Code takes time. It is hard to explain to your clients that they would have to wait for the next product release only to check the results of yet another design iteration.

So, static mockups remain Step One in almost any digital product process (Step Zero being the discussion of project requirements).

The problem with static mockups is that they can be designed rather quickly by professionals using tools like Sketch and Figma (and Adobe Photoshop a while ago)—but iterating over them and adding new features is an elaborate manual process that requires a lot of “pixel pushing”: re-arranging dozens of mockup layers on screen with every minor change.

The pain every designer feels :sob:

All of that changed after Figma introduced its Auto Layout feature. It bridges the gap between static designs and their dynamic incarnations in code.

As soon as Auto Layout was released, our design team was quick to rebuild their processes around the possibilities it brings.

We are going to share our learnings (with a lot of moving pictures), and at the end of this article you’ll discover a Figma artboard that you are free to use as a starting point for your dynamic designs!

For the sake of example, we will be using the same design system that powersMartian Chronicles—a notorious team blog that you are reading right now.

The hardest button to button

Buttons and their states :round_pushpin:

Pro Tip: You can put the button into an additional AL component to have full control over the width. Handy for mobile designs and for the cases where you need buttons of a set size.

Auto Layout makes it extremely easy to turn any text layer into a dynamic button, allowing you to set the same constraints that your frontend developers will impose in CSS. We’re talking horizontal and vertical paddings and margins, background properties, and corner radius. You can group buttons together and make them behave as a single grid that naturally converts to a flexbox-based CSS layout with a ready-to-use code.

Figma Auto Layout: Practical tips for dynamic designs

Generated CSS on the right does not look half-bad

En-list-ing the power of Auto Layout

Figma Auto Layout: Practical tips for dynamic designs

Auto Layout scaffold on the right, actual content on the left

Pro Tip: You can align an icon with your text using three available options: top, middle, and bottom.

We can design lists by bringing several Auto Layout components together. We use one for the horizontal alignment of a checkbox and a string of text, and another one for the vertical alignment of list items.

An important thing here is that we need to specify the width of the text block in the enclosing (vertical) component and set the Auto Height settings. Now you’ll be able to see the magic happening: text will find its lines dynamically, and the icons will automatically remain in place.

A magical self-aligning list :scroll:

Jaw-dropping drop-downs

Figma Auto Layout: Practical tips for dynamic designs

Highly customizable drop-down component that allows to control separators, wrapper, etc.

Pro Tip: Don’t hide your separators in the artboard view, as it will force Auto Layout to recalculate margins. Better set their opacity to zero.

A similar approach can be used to build dynamic inputs like drop-downs. The main difference from the list component is the addition of a separating rectangle. By controlling its borders and opacity, we can change the look and feel of our drop-down list. The first and the last separators are special as they don’t require enclosing borders: you can apply different stroke setting to achieve desired results. You can also use those invisible rectangles to regulate spacing.

Dynamic drop-down in action :sparkles:

Enable notifications

Figma Auto Layout: Practical tips for dynamic designs

Intricate nesting for notification components

Pro Tip: You can constraint the width of your text layers to avoid overflow.

Now, Let’s build a more complicated component with a title, a subtitle, an icon, and a separator. Auto Layout allows to combine all the building blocks, and add a custom margin around the inner primitives. Throw in “border bottom” and “border top” layers to avoid excessive symmetry that makes reading the text harder.

Controlling the text now yields the automatic formatting of the whole group leading to total designer satisfaction.

I wish those notifications would never be snoozed :zzz:

What’s in the cards?

Figma Auto Layout: Practical tips for dynamic designs

Reusable card components are the bread and butter of every designer

Pro Tip: You can reorder items in a group of components with arrow keys on your keyboard.

We build a card out of several primitives: image, tag, title, icon, and an icon “data string”. It is an example of a more complex component. To keep all the layers in check on resizing, we have constrained the width of the text element, exactly as in a previous example with notifications. That makes our cards reusable for different content types, as more text will just yield a taller card due to “auto height”. We can fix the text block size too, but not allowing, say, five lines of text: everything else will be nicely cut out. We recommend using the grid fill (we use magenta, out of respect for the printing past) to highlight the anatomy of the resulting element.

The house of cards :black_joker:

Auto Layout + Constraints = :heart:

Figma Auto Layout: Practical tips for dynamic designs

Figma constraint controls

Constraints help us focus on the actual design instead of mere pixel pushing. In Figma, we can make all our components behave predictably by tinkering with constraint settings. Combining it with Auto Layout lets us improve our design workflow even further.

Constraints without Auto Layout

To start working with constraints, you need to create a frame ( a hot key) and place your Auto Layout component inside. Now we can control the frame constraints, and Auto Layout will conform to them.

Constraints with Auto Layout

Pro Tip: If you encounter clipping on resize—double-click on the Auto Layout component to fit the contents automatically.

When we combine frames with Auto Layout, we get fewer options for constraints (for instance, we cannot stretch in multiple directions at the same time, but we can still replicate the default behavior: through controlling the orientation of the Auto Layout component.

Congratulations, you’ve made it to the end of our Figma tour! Now, feel free to grab the source file with all the examples and tweak it to your liking.

Of course, there is no such thing as an ideal design flow (cause otherwise there won’t be an internal conflict that drives the creativity, will it?), but Auto Layout brings us pretty close to the world where we don’t have to push pixels anymore. We can design every product iteration just once , by building a comprehensive library of one-size-fits-all components.

It also enables designers to communicate with developers more efficiently: as developers (we are talking frontend here), already reason in components . There is still far to go to achieve a perfect code-design synergy, but we believe that once we will all get there.

Feel free togive us a shout if you want to enlist Martian designers to help you find a perfect direction for your product. Take note that we never do “design for the sake of design,” and we always work in close cooperation with our engineers to deliver production-ready user experiences to our clients.

And stay tuned for more posts on how we get some extra mileage out of Figma—we have something exciting in the works that we will share with you soon.


以上所述就是小编给大家介绍的《Figma Auto Layout: Practical tips for dynamic designs》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Imperfect C++中文版

Imperfect C++中文版

威尔逊 / 荣耀、刘未鹏 / 人民邮电出版社 / 2006-1 / 75.0

汇集实用的C++编程解决方案,C++虽然是一门非凡的语言,但并不完美。Matthew Wilson使用C++十年有余,其间发现C++存在一些固有的限制,需要一些颇具技术性的工作进行弥补。本书不仅指出了C++的缺失,更为你编写健壮、灵活、高效、可维护的代码提供了实用的技术和工具。Wilson向你展示了如何克服C++的复杂性,穿越C++庞大的范式阵列。夺回对代码的控制权,从而获得更理想的结果。一起来看看 《Imperfect C++中文版》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具