GitHub

Grid System

Complete CSS grid system with 12-column layouts, responsive breakpoints, column spanning, and gap utilities. All classes are pre-compiled — no build step needed.

Basic Grid

Preview
1
2
3
4
5
6

Responsive Grid

Preview
1
2
3
4
5
6
7
8

12-Column Layout

Preview
Sidebar
Navigation, filters, etc.
Main Content
Primary content area spanning 9 of 12 columns on desktop, full width on mobile.

Column Spanning

Preview
span 2
1
1
1
span 3
span full

Gap Variants

Preview
gap-2
gap-2
gap-2
gap-2
gap-4
gap-4
gap-4
gap-4
gap-8
gap-8
gap-8
gap-8

Row Spanning

Preview
row-span-2
1
2
3
4

Auto Fill / Auto Fit

Preview

auto-fill (min 150px)

1
2
3
4
5

auto-fit (min 150px)

1
2
3

Nested Grids

Preview
Left Section
A
B
C
D
Right Section
1
2
3
full

Holy Grail Layout

Preview
Header
Main
Primary content area
Footer

Breakpoints

PrefixMin WidthExample
(none)0pxgrid-cols-1
sm:640pxsm:grid-cols-2
md:768pxmd:grid-cols-3
lg:1024pxlg:grid-cols-4
xl:1280pxxl:grid-cols-6

Available Classes

ClassDescription
.gridSet display to grid
.grid-cols-{1-12}Set number of columns
.grid-cols-noneRemove column template
.col-span-{1-12}Span across columns
.col-span-fullSpan all columns
.col-start-{1-13}Column start position
.col-end-{1-13}Column end position
.grid-rows-{1-6}Set number of rows
.grid-rows-noneRemove row template
.row-span-{1-6}Span across rows
.row-span-fullSpan all rows
.row-start-{1-7}Row start position
.row-end-{1-7}Row end position
.grid-flow-rowAuto-place by row
.grid-flow-colAuto-place by column
.grid-flow-denseDense auto-placement
.gap-{0-16}Gap between items
.gap-x-{0-8}Column gap only
.gap-y-{0-8}Row gap only
.auto-cols-autoAuto column size: auto
.auto-cols-frAuto column size: 1fr
.auto-rows-autoAuto row size: auto
.auto-rows-frAuto row size: 1fr
.place-items-centerCenter items on both axes
.place-content-centerCenter content on both axes
.place-self-centerCenter individual item

Responsive variants

All column (grid-cols-*) and span (col-span-*) classes support responsive prefixes: sm:, md:, lg:, xl:. Example: grid-cols-1 md:grid-cols-3 lg:grid-cols-4