Skip to content

Align Content

Use content-* utilities to control how runs (rows) are positioned along the cross axis of a wrapped flex or multi-row grid container.

Use content-start to pack runs against the start of the container’s cross axis.

Style('grid h-56 grid-cols-3 content-start gap-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])

Use content-center to center runs along the container’s cross axis.

Style('grid h-56 grid-cols-3 content-center gap-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])

Use content-end to pack runs against the end of the container’s cross axis.

Style('grid h-56 grid-cols-3 content-end gap-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])

Use content-between to distribute runs evenly along the cross axis with the first at the start and the last at the end.

Style('grid h-56 grid-cols-3 content-between gap-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])

Use content-around to distribute runs along the cross axis with equal space around each one.

Style('grid h-56 grid-cols-3 content-around gap-x-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])

Use content-evenly to distribute runs along the cross axis with equal space between each run and between the first/last run and the container edges.

Style('grid h-56 grid-cols-3 content-evenly gap-x-4 ...', children: [
Text('01'),
Text('02'),
Text('03'),
Text('04'),
Text('05'),
])
ClassDescription
content-startPack runs against the start of the cross axis.
content-centerPack runs in the center of the cross axis.
content-endPack runs against the end of the cross axis.
content-betweenDistribute runs evenly; first at start, last at end.
content-aroundDistribute runs with equal space around each.
content-evenlyDistribute runs with equal space between each and the container edges.
content-stretch(parity omitted — silently downgrades to content-start)
content-normal(parity omitted)
content-baseline(parity omitted)
  • content-stretch, content-normal, content-baseline — Flutter’s Wrap.runAlignment only supports start, end, center, spaceBetween, spaceAround, and spaceEvenly. The resolver silently downgrades content-stretch to WrapAlignment.start; content-normal and content-baseline are not parsed.
  • The container needs an explicit cross-axis size (e.g. h-40) for content-* to have visible slack to distribute. Without one, decorated containers shrink-wrap to content height and the runs render identically across all content-* values.