Layouts

Layouts in Automad are created using the Layout Section block. They can be added anywhere on a page and can contain other Layout Sections, allowing you to create complex, nested designs. Sections can also be set to stretch to the full width of the content area or page. Watch the short videos on this page to see these features in action.

Basics and Sizing

Inside a Layout Section, each element can be assigned a fractional width of the row: 1/4, 1/3, 1/2, 2/3, 3/4, or 1/1 for the full width. Elements with fractional widths are placed side by side as long as they fit into a row, which allows for consistent alignment and flexible column layouts.

Layout Section Settings

The Settings Toolbar is the central place for defining section styles and how blocks within a Layout Section behave. It establishes rules for alignment, spacing, nesting, and responsiveness that apply to all blocks in the section.

By defining layout settings, you can shape the overall structure of a layout before fine-tuning individual blocks. The following sections describe these controls in detail, covering horizontal and vertical alignment, spacing, and responsive layouts.

Horizontal Alignment

Using the toolbar, you can control how elements are aligned and distributed horizontally within a section. The following options are available:

  • Align content left, Horizontally center content and Align content right — align all elements of a row to one side or to the center.
  • Add space between elements — places the first and last element of a row at the edges and distributes the remaining space between the elements.
  • Justify elements evenly — distributes the remaining space evenly around all elements.
  • Stretch content in order to fill row — lets the elements grow until each row is filled completely.

Spacing Between Elements

Assigning a fractional width such as 1/2 or 2/3 to a block automatically creates a flexbox context. All adjacent blocks that also have an assigned width are grouped into this context and laid out side by side when space is available.

The Settings Toolbar lets you define a gap size that is applied consistently between all elements within the same flexbox context.

Vertical Alignment and Nesting

Vertical alignment within a Layout Section can be set to top, middle, bottom, or stretched to the full row height. This ensures consistent alignment even when columns have different heights.

Layouts can also be nested inside each other, enabling complex multi-column structures and flexible content arrangements.

The following example shows the nested hierarchy of elements when working with layout sections. The dashed outlines indicate where sections are used to create new column contexts.

Responsive Layouts

Layout Sections are responsive by default. In the toolbar, you can define a minimum width for child elements, which is 12rem by default. When elements become smaller than this width, they wrap to a new line.

Wrapping is always enabled. Wrapped elements follow the horizontal alignment of the section. For example, with Stretch content in order to fill row, the elements of a wrapped row grow until they fill the entire width. Together with the minimum width, this lets you control how layouts adapt to different screen sizes.

Styles and Settings

Besides arranging its child blocks, you can also change the look of a Layout Section itself. The Styles and Settings button in the toolbar opens a dialog with the following options:

  • Text color and Background Color
  • Border Style (none, solid, dashed, dotted, double, groove or ridge), Border Color, Border Width and Corner Radius
  • Add Shadow to lift the section off the page
  • Spacing Top and Spacing Bottom to add space above and below the content
  • Crop content to hide content that overflows the section
  • Optimize content for cards, as described in cards
  • Aspect Ratio, Background Image, Background Blendmode and Focal Point, as described below

In addition, like every other block, a section can have individual spacing for all four sides — top, right, bottom and left — in its block settings. The following sections describe aspect ratios, background images and cards in more detail.

Aspect Ratios

By default, a Layout Section grows with its content. Alternatively, you can enter a fixed aspect ratio such as 16/9 in the Aspect Ratio field. Content that doesn't fit into a section with a fixed aspect ratio is cropped.

To make the aspect ratio responsive, add breakpoints in the same max-width:width/height format that is used for images. For example, 600:1/1 900:4/3 shows the section as a square when it is narrower than 600px and in 4/3 format when it is narrower than 900px. Above the largest breakpoint, the fixed aspect ratio applies, or the section grows with its content if none is set. Note that breakpoints refer to the width of the section itself, not the browser window.

Backgrounds

In addition to a solid background color, a Layout Section can have a background image that covers the entire section. Select an image in the Background Image field and optionally choose a Background Blendmode to blend the image with the background color. Since the image is cropped to fit the shape of the section, especially with a fixed or responsive aspect ratio, you can also set a Focal Point by clicking or dragging on the image preview. The area around that point then always stays visible, just like the focal point of an image.

Cards

Layout Sections can be used to create call-to-action cards by applying section styles. These styles are accessed via the Styles and Settings button in the toolbar. Enabling Optimize content for cards automatically applies a default padding to the section, making it easy to add background colors, borders, and rounded corners without manual spacing adjustments.

Take Action

A card with a slideshow

Button

The following card uses a background image instead of a solid color.

Say Hello

A card with background image

Button
Blocks Components