Skip to content

Grid Auto Flow

Controls the automatic placement of grid elements.

Utility Properties
Error: 429

Column

This example sets the grid auto flow to column. The items will be placed in the grid by filling each column before moving to the next one.

A
B
C
D
E
<div class="d-g g-4 gaf-c gtc-3 gtr-3 ta-c tc-white" id="area">
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">A</div>
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo-8 p-4 rad-1">D</div>
<div class="bg-indigo-8 p-4 rad-1">E</div>
</div>

Dense

This example sets the grid auto flow to dense. The items will be placed in the grid in a way that fills in gaps as efficiently as possible.

A
B
C
D
E
<div class="d-g g-4 gaf-d gtc-3 gtr-3 ta-c tc-white" id="area">
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">A</div>
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo-8 p-4 rad-1">D</div>
<div class="bg-indigo-8 p-4 rad-1">E</div>
</div>

Row

Initial value

This example sets the grid auto flow to row. The items will be placed in the grid by filling each row before moving to the next one.

A
B
C
D
E
<div class="d-g g-4 gaf-r gtc-3 gtr-3 ta-c tc-white" id="area">
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">A</div>
<div class="bg-indigo-8 gc-s-2 p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo-8 p-4 rad-1">D</div>
<div class="bg-indigo-8 p-4 rad-1">E</div>
</div>

Row Dense

This example sets the grid auto flow to row dense. The items will be placed in the grid by filling each row first, while also attempting to fill any gaps efficiently.

A
B
C
D
<div class="d-g gaf-rd g-4 ta-c tc-white tc-white" id="area">
<div class="bg-indigo p-4 rad-1">A</div>
<div class="bg-indigo p-4 rad-1">B</div>
<div class="bg-indigo p-4 rad-1">C</div>
<div class="bg-indigo p-4 rad-1">D</div>
</div>

Conditional styles

Learn how to override existing utilities based on the userโ€™s screen size or other factors, such as hover states.

Media modifier

You can combine responsive breakpoints like sm:-*,md:-*, lg:-*, and xxl:-* allows targeting specific utilities in different viewports.

<div class="gaf-c md:gaf-r ..."></div>

Hover modifier

Alternatively, you can apply :hover by using h:-* utility to override elements and change their values when hovering over them.

<div class="gaf-c h:gaf-r ..."></div>