Exploring Group Resizing in Sketch

One of the items that’s long been on my personal wishlist for Sketch is the ability to work natively with responsive layouts, and the next Sketch release, version 39, (currently in beta) will finally introduce that via the new Group Resizing feature. Auto Layout-style functionality has been available since Sketch 3.3 (33) via the excellent Sketch Constraints plugin, but being able to work this type of layout magic without third-party plugins will be a major plus.

While I’m not a heavy user of the Sketch betas, Group Resizing had me excited enough to take it for a test drive, and I’m happy to say it works largely as advertised. I created a simple “Music News” view for a fictitious music app in order to try out the feature, creating the original layout and elements at iPhone SE scale (320 x 568 pixels). Scaling that layout up to iPhone 6 (375 x 667) and iPhone 6 Plus (414 x 736) was quick and painless.

My original iPhone SE artboard (left) scales easily to iPhone 6 and iPhone 6 Plus sizes.

So how does it work?

The new Group Resizing feature allows you to individually assign behaviors to each layer within a group. Each layer is assigned to react to resizing in one of the following four ways:

Your four layout behavior options when using the new Group Resizing feature in Sketch 39.

Stretch: This is the default behavior for a layer within a group, and it pretty much does what it says. Stretch is a useful setting for background colors and gradients, but quickly breaks constraints (i.e., stretch ≠ scale) when applied to photos, icons, or logos.

Pin to corner: When you have a layout element specifically intended to sit a certain distance from the edge of your artboard, Pin to Corner is the way to go. I was initially concerned that the pinning was relative to only one corner (i.e., top left), based on its icon and the standard X/Y positioning that Sketch employs, but it’s functionally smarter than that. This option appears to take into account the nearest corner to the layout when determining positioning, so if the layer sits near the right edge of the artboard, it’s repositioned relative to that side when resized (and vice versa on the left).

Resize object: Here’s your scaling functionality, and thus the behavior you’ll most often apply to image elements. This works really nicely when you’ve got images set as fills for vector shapes (such as the hero image for the featured story element in my sample layouts). It’s also the setting of choice for text layers that you want to automatically expand to flow into available space when scaling up to a larger artboard.

Float in place: If you want a layer to maintain its current relative positioning (e.g., if it’s aligned to the center of the artboard, or equidistant from other layouts in its group), Float in Place does the trick. I assigned this positioning to each icon in the tab bar, after spacing the icons equidistant from one another in the original 320px iPhone SE layout. When I resized the tab bar to wider widths (375px and 414px), the icons remained correctly sized and maintained their proportional spacing from one another.

I love it when a plan comes together

Getting the most out of Resizing in Sketch 39 is all about advanced planning, and mapping out the appropriate positioning for each individual element. Nothing about the functionality is automatic; Sketch isn’t going to inherently know how you expect the elements within a group or symbol to behave, but the four resizing options (stretch, pin to corner, resize object, and float in place) give you a remarkable degree of flexibility.

Below are examples of how I mapped out the positioning for each element of the navbar and list item symbols in the layout:

Once you’ve got all of your individual layer behaviors mapped out, it’s simply a matter of copying, pasting, and resizing each group or symbol. It’s pleasantly quick and painless, and likely a real productivity boost for anyone used to doing this manually, layer by layer.

Group Resizing in action (scaling iPhone SE elements up to iPhone 6).

Now it’s your turn

Ready to try Group Resizing out for yourself? You can download the Sketch 39 beta here, and I’ve posted my working Sketch file (featuring both the Music News layout shown here and a bonus article layout) to give you a jump start.

A word of caution: Files created or saved in Sketch 39 are not backwards compatible. You won’t be able to open them in Sketch 38. Don’t use the Sketch beta with any files you may need to share with users of previous versions of the app.

Comments are closed here.