Open this example in the interactive library
Source code
<div class="demo grid grid-cols-[repeat(auto-fill,minmax(4rem,1fr))] gap-2">
<span class="tile">One</span><span class="tile">Two</span
><span class="tile">Three</span>
</div>
Reserve empty columns with auto-fill with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<div class="demo grid grid-cols-[repeat(auto-fill,minmax(4rem,1fr))] gap-2">
<span class="tile">One</span><span class="tile">Two</span
><span class="tile">Three</span>
</div>