Align Items
Use items-* utilities to control how flex and grid items are positioned along the container’s cross axis.
Use items-start to align items against the start of the container’s cross axis.
Style('flex items-start ...', children: [ Style('py-4', child: Text('01')), Style('py-12', child: Text('02')), Style('py-8', child: Text('03')),])Center
Section titled “Center”Use items-center to align items along the center of the container’s cross axis.
Style('flex items-center ...', children: [ Style('py-4', child: Text('01')), Style('py-12', child: Text('02')), Style('py-8', child: Text('03')),])Use items-end to align items against the end of the container’s cross axis.
Style('flex items-end ...', children: [ Style('py-4', child: Text('01')), Style('py-12', child: Text('02')), Style('py-8', child: Text('03')),])Baseline
Section titled “Baseline”Use items-baseline to align items along the alphabetic baseline of their first text run. Asymmetric pt-* and pb-* paddings make the shared baseline visible across tiles of varying intrinsic heights.
Style('flex items-baseline ...', children: [ Style('pt-2 pb-6', child: Text('01')), Style('pt-8 pb-12', child: Text('02')), Style('pt-12 pb-4', child: Text('03')),])Stretch
Section titled “Stretch”Use items-stretch to make items fill the container’s cross axis.
Style('flex items-stretch ...', children: [ Style('py-4', child: Text('01')), Style('py-12', child: Text('02')), Style('py-8', child: Text('03')),])Class reference
Section titled “Class reference”| Class | Description |
|---|---|
items-start | Align items to the start of the cross axis. |
items-center | Align items to the center of the cross axis. |
items-end | Align items to the end of the cross axis. |
items-baseline | Align items to the alphabetic baseline of their first text run. |
items-stretch | Stretch items to fill the cross axis. |
items-baseline-last | (parity omitted) |
items-center-safe, items-end-safe | (parity omitted) |
Parity omissions
Section titled “Parity omissions”items-baseline-last— Flutter has no concept of “last baseline”. The dominant baseline is always the first text baseline of each child.items-center-safe,items-end-safe— the CSSsafekeyword falls back tostartwhen items would overflow the container; Flutter’s layout has no overflow-fallback alignment concept.- When the flex container wraps (
flex-wrap),items-baselinefalls back tostart. Flutter’sWrapwidget has no baseline run alignment. items-stretchonly fills the cross axis when each child has an explicitmin-h-*(orh-*) — decorated children with no explicit height shrink-wrap to their content via the library’s_applyShrinkWrapHeightquirk. Thealign-items-stretchexample above addsmin-h-48to the children to make the stretch visible.items-baselinealigns baselines near the top of the row in this library (Flutter’sRenderFlexpositions children so the first baseline reachesmax(baseline_from_top)of all children). Tailwind aligns near the bottom of a shrink-wrapped container; the resulting visual differs slightly even though both render the baselines on a common Y.