Combining Layout Guides & Constraints

Combine layout guides (grids) with constraints to create powerful responsive designs. Understanding how these features work together gives you precise control over how elements behave when frames are resized.

Core Concept

Constraints define how objects respond when you resize parent frames. Layout guides provide visual alignment aids. When combined:

Stretch Layout Guides

When using stretch grids, Azyrom evaluates constraints relative to the grid column or row the element belongs to:

The same applies to rows:

Key insight: Stretch layout guides adapt to the size of the frame. This allows your designs to respond when you resize the frame, while elements maintain their constraint relationships to the layout guide itself.

Fixed Layout Guides

When using fixed grids:

How Azyrom Detects Grid Cells

When applying constraints with a stretch grid present:

  1. Azyrom identifies which column the element belongs to based on its position
  2. Azyrom identifies which row the element belongs to
  3. Constraints are calculated relative to those grid cell boundaries
  4. When the frame resizes, grid cells stretch and elements respond according to their constraints

Example: Responsive Card Layout

  1. Create a frame with a 3-column stretch grid
  2. Place a card element in the first column
  3. Set the card's horizontal constraint to "Left & Right"
  4. Resize the frame - the card stretches to fill its column
  5. Duplicate the card to other columns for a responsive row

Best Practices

Constraint Quick Reference

Constraint With Stretch Grid With Fixed Grid
Left Relative to column left Relative to frame left
Right Relative to column right Relative to frame right
Left & Right Stretch within column Stretch within frame
Center Center in column Center in frame
Scale Scale with column Scale with frame

Related Topics