Auto Layout

Auto Layout automatically positions and sizes elements within a frame based on rules you define. Similar to CSS Flexbox and Grid, it creates responsive, maintainable layouts that adapt when content changes.

Enabling Auto Layout

  1. Select a frame containing child elements
  2. In the Properties Panel, find the Auto Layout section
  3. Toggle Enable Auto Layout
  4. Azyrom automatically infers initial layout settings from current positions

Note: Auto Layout only works on frames that contain child elements. The toggle will only appear for eligible frames.

Layout Modes

Row Layout

Arranges children horizontally from left to right:

Column Layout

Arranges children vertically from top to bottom:

Grid Layout

Arranges children in a two-dimensional grid:

Spacing Controls

Gap (Row/Column Modes)

Grid Gaps (Grid Mode)

Padding

Space between the frame edge and its children:

Sizing Modes

Primary Axis Sizing

Controls how the frame sizes along its main direction:

Counter Axis Sizing

Controls how the frame sizes perpendicular to its main direction:

Child Sizing

Individual children can override sizing behavior:

Grid Configuration

When Grid mode is active:

Advanced Options

Wrap Children

In Row/Column mode:

Stroke Included

Determines if child strokes are included in layout calculations:

Text Baseline Alignment

For layouts containing text elements:

Stacking Order

Controls how overlapping elements are layered:

Absolute Positioning

Children can opt out of auto layout:

Common Use Cases

Button with Icon

  1. Create a frame with an icon and text
  2. Enable Auto Layout in Row mode
  3. Set spacing to 8px, padding to 12px horizontal / 8px vertical
  4. Set both axes to "Hug Contents"
  5. Button automatically sizes to fit content

Card Layout

  1. Create a frame with image, title, description, and button
  2. Enable Auto Layout in Column mode
  3. Set spacing to 16px, padding to 24px
  4. Set primary axis to "Hug Contents", counter axis to "Fixed" (e.g., 300px width)
  5. Card height adapts to content while maintaining fixed width

Responsive Grid

  1. Create a frame containing multiple items
  2. Enable Auto Layout in Grid mode
  3. Set columns to 3, rows to 0 (auto)
  4. Set column/row gaps to 16px
  5. Grid automatically wraps items into rows of 3

Navigation Bar

  1. Create a frame with navigation items
  2. Enable Auto Layout in Row mode
  3. Set spacing to 24px, padding to 16px
  4. Set primary axis to "Fill Container", counter axis to "Hug"
  5. Navigation stretches full width while hugging content height

Tips and Best Practices

Auto Layout vs Manual Layout

Feature Auto Layout Manual Layout
Position Automatic based on rules Manual x/y coordinates
Size Can adapt to content Fixed dimensions
Responsive Automatically adapts Requires manual updates
Content Changes Layout updates automatically Must reposition manually
Best For UI components, lists, grids Illustrations, precise layouts
Flexibility Rule-based, predictable Total control, any position

Keyboard Shortcuts

Related Topics