Browse documentation

Reference / Flexbox & grid

Grid auto rows

Give automatically created rows a consistent size or a minimum that grows with their content.

Working example

The third item creates a second row. Minmax leaves room for translated labels or longer notes.

HTML
<div class="grid grid-cols-2 auto-rows-[minmax(3rem,auto)] gap-2">
  <p class="border p-2">Draft</p>
  <p class="border p-2">Proof</p>
  <p class="border p-2">Press check</p>
</div>

Class reference

ClassCSS declarations
auto-rows-autogrid-auto-rows: auto;
auto-rows-mingrid-auto-rows: min-content;
auto-rows-maxgrid-auto-rows: max-content;
auto-rows-frgrid-auto-rows: minmax(0, 1fr);
auto-rows-[minmax(3rem,auto)]grid-auto-rows: minmax(3rem,auto);
View full generated CSS
Compiled CSS
.auto-rows-\[minmax\(3rem\,auto\)\] {
  grid-auto-rows: minmax(3rem,auto);
}
.auto-rows-auto {
  grid-auto-rows: auto;
}
.auto-rows-fr {
  grid-auto-rows: minmax(0, 1fr);
}
.auto-rows-max {
  grid-auto-rows: max-content;
}
.auto-rows-min {
  grid-auto-rows: min-content;
}