How we took Good Structure past Symbols (Half 1) · Sketch


We’ve simply launched a significant replace to Good Structure, taking it far past its roots in Symbols. This newest replace builds upon an earlier one that made Good Structure extra dependable and predictable, together with associated enhancements to Good Distribute.

This was a very long time within the making and, on this three-part sequence, the mission workforce will take a deep dive into these updates, from the challenges they confronted, to the work that led us to in the present day.


We launched Good Structure to Sketch in late 2019, constructing upon Symbols and Libraries, with the goal of creating Symbols extra versatile:

With Good Structure, you may say goodbye to manually resizing Symbols to suit their overrides, or constructing a number of Symbols inside the identical design, simply to accommodate completely different sizes of the identical element. Now, Sketch can deal with all of that.

Merely set your Structure properties in your Image supply and it’ll resize routinely everytime you edit an override in one in every of its cases. Higher nonetheless, Good Structure maintains the padding and spacing between layers in your Image because it grows within the path you’ve set.

The premise was easy, however the objective was bold. Proper after launch, we noticed loads of prospects adopting Good Structure and make it a elementary a part of their work. Over time, we managed to ship just a few enhancements whereas we targeted our consideration on different closely requested options.

Just lately, we determined to come back again to Good Structure and take it a giant step ahead. We knew it wouldn’t be a trivial effort (and it wasn’t!), but it surely was necessary and mandatory.

With the intention to perceive the difficulties we got here up towards, we should take a step backwards and perceive the fundamentals. What’s Good Structure, in spite of everything? And the way does it truly work? Let’s break it down.

What Good Structure is — and isn’t

Let’s begin by understanding what Good Structure truly is. It’s primarily based on three key ideas:

  1. Minimal setup. It asks the designer for one factor solely: how is that this design laid out? There’s a alternative of two orientations — horizontal or vertical — every with three decisions of the place to anchor the format — left/middle/proper or prime/center/backside, respectively. These decisions set the format’s axis and path properties.
  2. Freeform association. Designers aren’t restricted to a particular kind of format. Layers may be positioned and spaced in any approach designers need: specified by a stack, side-by aspect, totally or partly overlapping, or a mixture of some or all of those directly, with any quantity spacing between them.
  3. One single system. It takes care of two key duties of managed format techniques directly. First, layers should adapt to layers contained inside: comparable to a button, which in its easiest type is a textual content layer surrounded by a rectangle. Second, layers should adapt to adjoining layers: take two textual content blocks laid out vertically, the place the underside one should transfer down as the highest one grows.

To raised perceive this, it could be useful to match Good Structure to format techniques which can be strictly stack-oriented. With these, layers sometimes have to be organized in single row or column (typically with strictly even spacing with out exceptions) and have to be complemented by different techniques for layer containment, since overlaps aren’t doable (style-able containers with express padding).

We designed Good Structure so it accommodates however isn’t restricted to stack-based layouts.

How Good Structure truly works

The job of Good Structure, as with all different managed system, is to reply to adjustments to a given layer by manipulating different layers in a approach that respects the consumer’s prior decisions and intention.

To do this, Good Structure considers three inputs:

  1. The format chosen by the designer. What are its axis and path?
  2. The change that was made. Did the layer(s) develop or shrink, or disappear?
  3. The present state of the design. Which different layers are in or adjoining to the modified area, and what’s their spatial relationship to the modified layer(s)?

Whereas the primary two inputs are quite simple, the latter may be extraordinarily complicated.

The freeform association and low express setup traits that make Good Structure distinctive additionally make it uniquely difficult to develop. We have now to judge the spatial relationship between the modified layer(s) and different layer of their rapid context to deduce the designer’s implicit intent from their design. (Trivia reality: Inferred Structure is the unique growth identify of Good Structure).

An image showing the different spatial relationships between layers affected by Smart Layout.

Spatial relationships between the reference layer and different layers, and actions taken for every.

When doing this analysis, we now have to contemplate:

  • Six doable spatial relationships between every unchanged layer and the modified layer(s) alongside the format axis: it might be earlier than its forefront, overlapping its forefront, surrounding it, surrounded by it, overlapping its trailing edge, or after its trailing edge.
  • Seven doable mixtures of the three resizing constraints — fastened dimension, pinned forefront, and pinned trailing edge — utilized to every unchanged layer alongside the format axis.

Collectively, these signify 42 doable mixtures for a given layer change for every unchanged layer within the hierarchy stage of the modified layer. Plus, Good Structure works recursively — adjustments to nested layers result in adjustments up the hierarchy, as teams adapt to their dimension of their contents.

Whereas this analysis may be fairly complicated, any change in any state of affairs leads to simply one in every of solely three penalties for an unchanged layer: transfer it, develop or shrink it, or do nothing.

Even easy layouts will typically comprise completely different spatial relationships and result in all three actions.

Moreover, if the change that was made was {that a} layer disappeared, we additionally want to contemplate what to do to the house adjoining to that layer. We’ll go into this in additional element in our subsequent publish.

Lastly, we should contemplate the path alongside the format axis. Good Structure is in actual fact path agnostic, at all times working left-to-right for horizontal layouts and top-to-bottom for vertical ones. If one in every of every axis’s different two instructions is used, it merely compensates for that by offsetting every component which has Good Structure utilized to it, by half or the complete quantity of the whole change. Nonetheless, for adjustments to layers overlapping alongside the format axis and a few format instructions, we rigorously modify the place of particular person layers, too.

The challenges we confronted with Good Structure

As we regarded to enhance Good Structure, we have been confronted with three fundamental challenges.

  1. Good Structure’s outcomes could possibly be surprising and inconsistent. Easy instances have been superb, however its means to work with any layer association means there’s an infinite variety of doable situations, and thus extra probabilities it might fail to deduce probably the most anticipated consequence. In the end, it fell beneath our requirements, and it wanted to develop into a lot smarter and extra dependable.
  2. Good Structure was not accessible to teams outdoors of Symbols. This was by far one in every of our most requested options, and it was main folks to create Symbols merely to make the most of Good Structure — which comes with its personal set of tradeoffs.
  3. The recognition of stack format techniques created an expectation mismatch. It’s solely pure, given the recognition of those techniques, for folks to anticipate {that a} key managed format characteristic known as “Good Structure” could be our implementation of a stack format system. Even if it’s not, we wanted to raised accommodate that expectation when it’s utilized in a stack association.

On prime of this, we had some aggravating components.

  • Good Structure’s means to work with any layer association additionally imply that adjustments to its logic could also be dangerous, because it’s exhausting to foretell with full confidence what the complete extent of the implications of a change could possibly be, when taking a look at any given state of affairs in isolation.
  • Because it’d been launched just a few years prior and develop into standard, Good Structure was ever-present in paperwork, and significantly in Libraries that are distributed to many paperwork throughout the workspace, and generally outdoors of it. This massive utilization base meant that any regressive adjustments we made may have huge implications and be extremely disruptive for a lot of.

The problem was a tall one, so it was time to assemble a workforce and type a plan.

The highway forward

Whereas Good Structure appears easy on the floor, we’ve now seen how there’s a good quantity of complexity behind the scenes. With this in thoughts, we knew we wanted one constant workforce all through this effort, who may all develop familiarity and experience with the system. We assembled two full-time engineers, plus one QA, one PM, and one designer supporting it alongside their different ongoing tasks.

Our final objective was to deliver Good Structure to teams and provides particular consideration to its use in stack-based layouts, however we couldn’t get there in a single day. We put a plan in movement that allowed us to construct in the direction of that objective piece by piece, whereas bringing some mandatory enhancements alongside the best way:

  • First, we’d make Good Structure extra dependable, however nonetheless restricted to Symbols. It was merely not acceptable to deliver Good Structure to teams earlier than we improved its core logic. We knew that doing so would solely expose its deficiencies in additional situations, which might rightly frustrate customers. Plus, a wider set up base would solely make it tougher for us to enhance it sooner or later.
  • In parallel, we’d additionally enhance our stacking options. These options — Tidy and Good Distribute — have existed for a while, and we knew they’d play a task as soon as Good Structure arrived in Teams, since they naturally assist to make and manipulate evenly-spaced stacks.
  • After this, we’d deliver Good Structure to teams. This could be sufficient of an effort by itself, since teams don’t have the restrictions that Symbols do, permitting designers to freely resize or delete any of its layers, or inserting new ones altogether.

We had our work reduce out for us, and we knew it’d be a protracted journey, however an necessary one.


Within the subsequent publish within the sequence we’ll describe how we made Good Structure extra dependable, and within the third publish we’ll conclude the journey by taking a look at what it took to lastly deliver it to teams.

To maintain up with sequence, hold an eye fixed on the weblog or observe us on X or Mastodon for updates.



Leave a Reply

Your email address will not be published. Required fields are marked *