Row

Horizontal flex container for column-based layouts. Controls direction, wrapping, gap, alignment, and justification.

Base Row

The simplest form: flex flex-row on a container. Children line up horizontally; no wrapping by default.

Col A
Col B
Col C

Three equal children — default alignment is stretch for height, flex-start for justify.

Gap Scale

Use gap-* to set space between children uniformly. Prefer gap over margins — it composes cleanly with wrapping rows.

gap-1 (4px)

1
2
3
4

gap-2 (8px)

1
2
3
4

gap-4 (16px)

1
2
3
4

gap-6 (24px)

1
2
3
4

gap-8 (32px)

1
2
3
4

Justify Content

Controls how children are distributed along the main axis (horizontal for a row).

justify-start

A
B
C

Pack to the left

justify-center

A
B
C

Center the group

justify-end

A
B
C

Pack to the right

justify-between

A
B
C

Space between — first/last touch edges

justify-around

A
B
C

Equal space around each child

justify-evenly

A
B
C

Truly equal gaps between and around

Align Items

Controls how children are aligned on the cross axis (vertical). Requires children of mixed or intrinsic height to see the difference.

items-start

S
M
L

Snap to top

items-center

S
M
L

Center vertically

items-end

S
M
L

Snap to bottom

items-stretch

S
M
L

Stretch to fill row height (default)

items-baseline

S
M
L

Align text baselines

Wrap Behaviour

By default flex rows do not wrap. Add flex-wrap to allow children to flow onto new lines when they overflow.

flex-nowrap (default)

1
2
3
4
5
6
7

Overflow hidden — items may be clipped.

flex-wrap

1
2
3
4
5
6
7

Children reflow onto the next line.

Reverse Direction

flex-row-reverse reverses the visual order without changing DOM order — useful for RTL or mirror layouts without touching markup.

flex-row

First
Second
Third

flex-row-reverse

First
Second
Third

Grow & Shrink

Combine flex-1 (grow + shrink) with fixed-width siblings for classic sidebar / main layouts.

Fixed + flex-1 + Fixed

Sidebar
Main (flex-1)
Aside

flex-1 + flex-2 ratio

1 part
2 parts

flex-shrink-0 guard

No shrink
Fills the rest
No shrink

Interactive Playground

Adjust the controls to explore how flex row properties compose.

Generated class:

Real-world Patterns

Common layouts built entirely from row + alignment utilities.

Topbar — logo + nav + actions

Logo
Home
Products
About
Search
Cart

Media object — thumbnail + text

img
Username
Post content goes here…

Form row — label + input + button

Email
input field
Subscribe

Row vs other layout primitives

  • Row — one-dimensional horizontal container. Use when children are inline and you control main-axis distribution.
  • Grid — two-dimensional. Use when you need both row and column control, or when children must snap to named areas.
  • Column — a child unit inside a Row or Grid. Controls its own span, growth, and offset within the parent track.
  • flex-wrap — turn a row into a tag-cloud or chip-group. For strict multi-row grids, prefer CSS Grid.