Course 1 · Interaction & UI Design · Advanced

Constraints and grids — designs that resize

A screen looks pixel-perfect at the width you designed it, then someone opens it on a wider phone and the header logo floats into the middle while the button sticks to nothing — because nothing told each element how to behave when its frame changes size.

Read this module through your lens

New to design: this is how one design survives many screen sizes without redrawing it.

Two different kinds of change

You learned auto layout to survive content change — a label getting longer, a list gaining items. There is a second kind of change a real design must survive: the frame itself getting wider or narrower, because products run on many screen sizes. Auto layout does not fully solve this; you need constraints and grids.

The symptom of ignoring them is familiar: a screen that is pixel-perfect at the one width you designed it, and falls apart at any other. The logo drifts to the middle, the button anchors to empty space, the content clusters on one side. Nothing is “wrong” — you simply never told the elements how to behave when their container resizes, so they all defaulted to staying put.

Mastery of layout means designing for a range of sizes, not a single canvas. Constraints and grids are the tools that make one design hold across that range.

Constraints: how each element anchors

A constraint tells an element how to position and size itself when its parent frame changes width or height. Horizontally, an element can pin to the Left, pin to the Right, stay Centered, stretch to follow both Left and Right edges, or Scale proportionally. Vertically, the same against Top and Bottom. You set these per element in the right panel.

Think in intent. A back button belongs in the top-left always, so pin it Top + Left. A profile icon belongs top-right, so Top + Right. A search field that should span the width between them gets Left + Right, so it stretches as the frame widens. A centered logo gets Center. Get these right and the screen reorganizes itself sensibly at any width.

The crucial habit: actually resize the frame to test. Constraints are invisible until the frame changes size, exactly like rigging is invisible until you pose it. Drag the frame wider and narrower and watch every element; anything that drifts or overlaps has the wrong constraint.

Grids: the shared structure

The other half is the layout grid — a column system you add to a frame and align everything to. A common choice is a multi-column grid (say 12 columns with set margins and gutters), the same structure responsive web layouts use. With it, every element snaps to consistent column boundaries, so alignment stops being eyeballed and becomes systematic.

Grids do two things. They make a screen feel coherent, because everything shares the same underlying rhythm, the way a spacing scale did for gaps. And they give you and engineering a shared language for responsiveness: “this card spans 4 columns, the sidebar spans 3,” which maps directly onto how the build will reflow at breakpoints.

So the full picture: auto layout for content that grows, constraints for how elements respond to frame size, and a layout grid for the structure they all align to. Together they turn a one-width mockup into a design that holds across the real range of devices.

Hands-on exercise

Take a screen and make it responsive. Add a layout grid and align the content to its columns. Set constraints by intent on the key elements — pin a nav’s logo Left and its icon Right, stretch a search field, center anything that should stay centered. Then resize the frame wider and narrower and watch: fix every element that drifts or overlaps until the screen holds across the range. Capture a wide and a narrow state side by side.

The same lesson, a different object

first try

A nav bar with a logo on the left and a profile icon on the right, designed at 375px and looking perfect.

problem

Opened at 430px, both the logo and the icon stay glued near the left (default top-left constraint), leaving a big empty gap on the right — the bar no longer spans its container.

fix

Constrain the logo to Left, the profile icon to Right, and the search field between them to Left+Right (stretch). Resize the frame and the bar now adapts to any width.

The failure gallery

Each of these is caught by a quality gate — keep the cheatsheet open while you work.

Watch the journey

Screen-recording: dragging a frame wider and watching a correctly-constrained nav bar adapt vs a left-pinned one breaking. video slot · supplementary to the written core
Constraints tell each element how to respond when its parent resizes (pin, stretch, center); layout grids give a shared column structure to align to. Auto layout handles content growth; constraints and grids handle frame and viewport change.

Cheatsheet

Recipe & shortcuts
Per element, set Constraints (right panel): Left/Right/Center/Scale horizontally; Top/Bottom/Center/Scale vertically. Pin a back button Top-Left; stretch a search field Left+Right; center a logo. Add a Layout Grid to the frame: columns (e.g. 12 col, margins, gutters) to align to. Resize the frame to TEST; auto layout for content, constraints for frame size.
Failure modes
  • Everything left-top pinned, so nothing adapts on resize
  • Elements drifting/overlapping when the frame widens
  • No grid, so alignment is eyeballed and inconsistent
  • Confusing auto layout (content) with constraints (frame size)
  • Designing at one width and never resizing to check
Key operations
  • Set horizontal/vertical constraints per element
  • Use stretch (left+right) for things that should span
  • Add a columns layout grid and align to it
  • Resize the frame to verify responsive behavior
Quality gates
  • Does the layout hold when you widen and narrow the frame?
  • Are nav/anchored items pinned correctly (e.g. back button top-left)?
  • Do spanning elements stretch rather than drift?
  • Is content aligned to a layout grid, not eyeballed?
Workflow steps
  • Add a layout grid to the frame
  • Set constraints on each element by intent
  • Resize the frame wider and narrower
  • Fix any element that drifts or overlaps
Next module
  • Course 2 — Prototyping & Animation: proto_first_flow.

Reflection card

Active retrieval — answer from memory before re-reading. Saved to this browser.

  • A frame whose elements stay correct when widened and narrowed (a tested screen).
  • Constraints set by intent (pinned, stretched, centered) on the key elements.
  • A layout grid applied and content aligned to it.

Next: Course 2 — Prototyping & Animation: proto_first_flow.

Finish — back to Interaction & UI Design →