Sketch Smart Layout: Controlled Resizing for Design System Components
Smart Layout makes Sketch symbols resize automatically, but directional constraints and nesting choices determine whether it helps or hinders your design system.
03 Jun 2026, 18:26 UTC

The problem: text overrides that break fixed-width components
When a navigation bar contains a label that changes—localized text, a user’s display name, or a longer page title—a fixed-width background or container stops fitting. Designers end up manually stretching rectangles, nudging icons, and correcting every instance after each override. In a shared library, that drift multiplies quickly.
How Smart Layout infers constraints
Smart Layout applies directional resizing rules to a Symbol Source or Group. When enabled, Sketch inspects the current layer arrangement: horizontally stacked layers receive horizontal spacing constraints, and vertically stacked layers receive vertical constraints. The rules are inferred once, at enable time. After that, overrides that change a layer’s intrinsic size—text length, image dimensions, or visibility—trigger an automatic reposition of siblings.
It is a one-dimensional flow layout: horizontal, vertical, or both. It does not wrap items to a new line or align baselines, so wrapping grids still require multiple rows or Sketch’s separate Grid layout mode.
Worked example: a responsive navigation bar
Assume Sketch 90 or later on macOS. This example builds a navigation bar whose background widens when the label grows.
1. Draw a background rectangle and add a text layer for the label.
2. Place an icon layer to the left of the text, with consistent spacing between them.
3. Select the background, icon, and text layer, then create a Symbol named “Nav/Bar”.
4. With the Symbol Source selected, open the Inspector and set Smart Layout to Horizontal.
The Layer List shows a double-ended arrow icon on the Symbol Source.
5. Insert an instance and override the label to a longer string, such as “Account settings”.
The background expands horizontally while preserving the original padding.
6. Duplicate the Symbol Source, switch the copy to Vertical Smart Layout, and stack the icon above the label for a vertical variant.
Because Smart Layout was enabled on the Symbol Source, every instance inherits the rule. There is no per-instance opt-out, so changing the master affects all existing instances immediately.
Nested groups and override behavior
You can nest Smart Layout groups inside a Symbol. For example, a card component can contain a button symbol with its own Horizontal Smart Layout. The card’s outer group resizes as the inner button grows, but each nesting level adds layout computation. Keep nesting shallow in large documents.
Override behaviors:
- Text overrides trigger an immediate resize of the constrained layer.
- Image overrides preserve aspect ratio unless the layer is set to Fill in the Inspector.
- Hidden layers collapse their allocated space, so optional icons or badges disappear without leaving gaps.
Trade-offs and limitations
- No wrapping: Smart Layout cannot flow items onto a new line. Use multiple rows or Grid layout mode for wrapping grids.
- One-shot inference: Reordering layers after enabling Smart Layout can produce unexpected gaps or overlaps.
- All-instances effect: Enabling or disabling Smart Layout on a Symbol Source changes every instance at once. Roll out shared library changes during low-traffic periods.
- Plugin API is read-only: The JavaScript API exposes Smart Layout properties but cannot trigger a recalculation; the UI must perform the resize.
- Static exports: SVG and PDF snapshots capture the current instance dimensions, not the live layout rules.
Practical rollout checklist
- Audit components that change size after overrides: buttons, chips, navigation bars, and form fields.
- Enable Smart Layout on a single Symbol Source first, then verify the override behavior in an instance.
- Disable Smart Layout on static background layers that never resize, such as decorative shapes.
- Check the Layer List for the Smart Layout icon (double-ended arrow) and confirm its tooltip shows the intended direction.
- Benchmark with 500+ duplicates of a high-use component, edit the master, and observe canvas redraw latency. If redraws feel sluggish, flatten nesting or move the component to a separate library file.
- Document the Smart Layout direction and override expectations for each component in your design system documentation.
Smart Layout works best when treated as a constrained, one-dimensional flow engine rather than a full flexbox replacement. With careful direction choices and shallow nesting, it removes much of the manual resizing that slows down design system maintenance.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.