Flex Grid

FlexGrid uses Flexbox to create a multi-column layout.


Create Grids without worrying about leftover items

FlexGrid automatically expands leftover items so they don’t feel like orphans.

index.html
<div class="FlexGrid [--cols:3]">
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
</div>

Center leftover items for better presentation

FlexGrid lets you center leftover items instead of expanding them. This can be amazing for presentation when building landing pages or dashboards

index.html
<div class="FlexGrid justify-center [--cols:3] [--grow:0]">
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
</div>

Span multiple columns

Each child in FlexGrid can also span multiple columns. Use this to create any layout you wish.

index.html
<div class="FlexGrid [--cols:6]">
<div>...</div>
<div class="[--span:2]">...</div>
<div class="[--span:3]">...</div>
</div>

Responsive grids without media or container queries

FlexGrid lets you determine the minimum width of each item. Once defined, FlexGrid does the rest and creates a responsive layout for you.

index.html
<div class="Masonry md:[--cols:2] lg:[--cols:3]">
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
<div>...</div>
</div>
Resize to see this work!