← Blog

Day 16 Tutorial - WordPress Layout Types: Flow, Constrained and Flex

By Umar Shakar · 28 Oct 2026 · WordPress

Part of the WordPress Block Editor in 60 Days series · All lessons

On this page

← Previous: Day 15, Borders, Radius, and Shadows

Welcome to Day 16 of the 60-Day WordPress Block Editor Tutorial Series. Every Group, Row, Stack, and Columns block arranges its children using a layout type. Understanding the three types explains why blocks behave the way they do. Time needed: 10 minutes reading + 30 minutes practice.

What You Will Learn Today

Reading: How a Container Arranges Its Children

Select a Group and look in the Settings tab for Layout. You will see the layout type. Row and Stack are simply Group blocks with a Flex layout already chosen (horizontal and vertical).

Flow (Default)

Blocks stack one under another at the full width of the container, like a normal document. Children can float left or right when aligned. Flow is the simplest, but it gives you no content-width limit.

Constrained

Constrained is Flow plus a content width. Children are centered and limited to a maximum width (for example 650 px), while blocks set to Wide or Full alignment can break out. This is the layout of most block theme pages, and it is why paragraphs are a readable width while a Cover spans the screen.

WordPress Row block with three items spread across the row and the Layout panel showing Justification, Orientation and Allow to wrap to multiple lines
A Row block selected. Justification is set to space between, and Allow to wrap to multiple lines is turned on in the Layout panel. Screenshot taken by Umar Shakar in WordPress Playground (WordPress is GPL-2.0-or-later software).

Flex

Flex arranges children in a row (horizontal) or column (vertical) and gives you alignment controls:

Typical Row uses: a logo beside a menu, buttons side by side, an icon beside text. Typical Stack uses: a card whose pieces align neatly in a column.

Choosing the Right One

Key takeaway: Flow stacks, Constrained centers and limits width, and Flex arranges in a line with alignment controls.

What the Markup Looks Like

<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:paragraph -->
<p>Left item</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Right item</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

5 Examples to Follow Along

Example 1: Constrained vs Flow

Create a Group with three paragraphs and set its layout to Flow, then Constrained. Notice that in Constrained the text is centered at a readable width.

Example 2: Full Width Section

Align a Group to Full width. Inside it, keep Constrained so the text stays readable while the background spans the screen.

Example 3: Build a Row

Insert a Row with two Buttons. Set justification to space between and see the buttons move to opposite sides.

Example 4: Turn On Wrapping

Add five buttons to a Row. Preview on mobile with wrapping off, then on. Wrapping stops the items from squeezing.

Example 5: A Vertical Stack

Create a Stack with an image, a heading, and a paragraph and center the items. Check the markup for "orientation":"vertical".

<!-- wp:group {"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
<div class="wp-block-group"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Centered card</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Everything is centered in a column.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

Questions

Try to answer each question yourself first, then open the answer.

Question 1: What is the difference between Flow and Constrained layout?

Show answer

Flow stacks children at the full width of the container. Constrained limits and centers children to a content width, while allowing Wide and Full blocks to break out.

Example: a blog page uses Constrained so paragraphs stay about 650 px wide while an image can be Wide.

Question 2: What are Row and Stack?

Show answer

They are Group blocks with a Flex layout. Row is horizontal and Stack is vertical.

Example: a Row for a button pair, and a Stack for the pieces of a card.

Question 3: What does Allow to wrap do?

Show answer

It lets items move to a new line when they do not fit, which prevents tiny squeezed items on mobile.

Example: six badge icons in a Row wrap into two lines on a phone.

Question 4: How can a section span the screen but keep readable text?

Show answer

Align the outer Group Full width and give it a Constrained layout, so its children stay at the content width.

Example: a blue band across the page with a centered 650 px paragraph.

Question 5: Why does a block not go Wide or Full in a Flow layout?

Show answer

Wide and Full alignment depend on the parent layout and theme support. In Constrained layouts they work as expected, and in other layouts they may be ignored.

Example: an image aligned Full inside a Row will not span the screen, but it does if its parent is a top-level Constrained Group.


MCQs (Multiple Choice Questions)

MCQ 1: Which layout centers children at a max width?

Show answer

A) Constrained. It uses the content width setting.

MCQ 2: A Stack is a Group with:

Show answer

A) Vertical Flex layout. Row is horizontal and Stack is vertical.

MCQ 3: Allow to wrap is useful for:

Show answer

A) Small screens. Items drop to the next line instead of squeezing.

MCQ 4: Space between justification:

Show answer

A) Pushes items to opposite ends. Free space is distributed between the items.

MCQ 5: Which layout is typical for a full width page section?

Show answer

A) Group with Constrained layout, Full alignment. The section spans the screen while the text stays readable.


Practice: 10 Tasks from Easy to Hard

Create a new draft page called Practice Day 16 and work through the tasks in order. Where a snippet is given, open Options → Code editor, paste it, then switch back to the Visual editor.

Task 1 (Easy): Find the layout setting

Select a Group and find the Layout panel in the Settings tab.

Task 2 (Easy): Switch types

Switch a Group between Flow and Constrained and describe the change.

Task 3 (Easy): Insert a Row

Add a Row with two buttons.

Task 4 (Easy): Insert a Stack

Add a Stack with a heading and a paragraph.

Task 5 (Medium): Justify

Try left, center, right, and space between in a Row.

Task 6 (Medium): Wrapping test

Add six buttons to a Row and compare wrapping on and off in mobile preview.

Task 7 (Medium): Change content width

Set a custom content width for one Group and compare it with the theme default.

Task 8 (Medium-Hard): Build a header-like bar

Create a Row with a site title on the left and three links on the right, using space between.

Task 9 (Hard): Fix the layout

Paste the snippet below. The buttons are squeezed on mobile. Fix it using one layout setting.

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:paragraph -->
<p>Service one</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Service two</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Service three</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Service four</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

Task 10 (Hard): Design a landing band

Create a Full width section with a background and a Constrained inner layout containing a heading, text, and a Row of two buttons.


Coming Up Next

In Day 17 you will learn the Grid block and layout.

← Previous: Day 15, Borders, Radius, and Shadows

Next: Day 17, The Grid Block →

Need a website, SEO or a custom business app?
I'm Umar, a web developer and SEO specialist in Abu Dhabi. Get in touch.