Flexbox & Grid
Utilities for controlling the size of implicitly-created grid rows.
Use the auto-rows-*
utilities to control the size of implicitly-created grid rows.
<div class="grid grid-flow-row auto-rows-max">
<div>01</div>
<div>02</div>
<div>03</div>
</div>
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:auto-rows-min
to only apply the auto-rows-min
utility on hover.
<div class="grid grid-flow-row auto-rows-max hover:auto-rows-min">
<!-- ... -->
</div>
For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:auto-rows-min
to apply the auto-rows-min
utility at only medium screen sizes and above.
<div class="grid grid-flow-row auto-rows-max md:auto-rows-min">
<!-- ... -->
</div>
To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.
By default, Tailwind includes four general purpose grid-auto-rows
utilities. You can customize these values by editing theme.gridAutoRows
or theme.extend.gridAutoRows
in your tailwind.config.js
file.
module.exports = {
theme: {
extend: {
gridAutoRows: {
'2fr': 'minmax(0, 2fr)',
}
}
}
}
Learn more about customizing the default theme in the theme customization documentation.
If you need to use a one-off grid-auto-rows
value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
<div class="grid grid-flow-row auto-rows-[minmax(0,_2fr)]">
<!-- ... -->
</div>
Learn more about arbitrary value support in the arbitrary values documentation.