.grid-container {
display: grid;
grid-template-columns: 200px 1fr 200px;
grid-template-rows: 64px 1fr 48px;
grid-template-areas:
"header header header"
"sidebar main aside"
"footer footer footer";
gap: 12px;
}
.header {
grid-area: header;
}
.sidebar {
grid-area: sidebar;
}
.main {
grid-area: main;
}
.aside {
grid-area: aside;
}
.footer {
grid-area: footer;
}CSS Grid Builder — Visual Grid Layout Generator
What's included
Features
About this tool
Build a CSS Grid Layout Visually — Named Areas, fr Units, Export CSS or Tailwind
You know you need grid-template-areas for a dashboard layout, but writing it as quoted ASCII art and remembering the right grid-area name for each child is slow and error-prone. Draw the layout on the live canvas, drag to create named areas, and the tool generates the complete CSS — including both the container rule with grid-template-columns, grid-template-rows, and grid-template-areas, and the individual grid-area rules for every named child. No memorizing coordinate systems, no counting quoted strings.
The canvas renders a real CSS Grid — not a simulation. Drag across cells to create a named area. The area appears as a colored overlay with a label. Double-click to rename it. The areas panel on the left lists all regions in color-coded form with their column×row span shown alongside. Column and row track inputs accept any valid CSS value: fr, px, %, auto, minmax(100px, 1fr). The column gap and row gap sliders control gutters independently from 0 to 48px. The justify-items and align-items controls let you set item alignment across all cells simultaneously.
Six presets cover the most common real-world layout patterns: Holy Grail (full-width header, three-column middle with two fixed sidebars and a fluid main, full-width footer), Sidebar (fixed-width nav plus fluid main), 3-Column (equal fluid columns with header and footer), Dashboard (four-column layout with stat cards and a wide content zone), Blog (article plus fixed-width sidebar), and Card Grid (four-column card layout with a spanning wide card). Click any preset to load a complete layout with named areas and start customizing from there.
Export in 5 formats: CSS with grid-template-areas string and child grid-area rules, SCSS with $col-gap and $row-gap variables, Tailwind HTML with grid-cols-*, col-span-*, and row-start-* utility classes, a complete React component with an inline styles object and JSX, or a standalone HTML file with embedded CSS ready to open directly in a browser. All processing is 100% client-side — no data is uploaded anywhere.
Step by step
How to Use
- 1Choose a layout presetClick one of the six preset buttons in the header — Holy Grail, Sidebar, 3-Column, Dashboard, Blog, or Card Grid — to instantly load a complete layout. The canvas refreshes with colored named areas showing the grid structure. Presets are the fastest starting point; you can customize everything after loading one.
- 2Add and configure columns and rowsIn the left panel, the Columns section lists each column track with an editable text input. Type any valid CSS track size:
1fr,200px,auto,minmax(100px, 1fr), or a percentage. Click "+ Add" to append a new column, or click × next to any column to remove it. The Rows section works identically for horizontal tracks. - 3Create named grid areas on the canvasClick and drag across empty cells on the canvas to draw a new area. Release the mouse to commit — the area auto-names as area1, area2, etc. Double-click an area name in the canvas or in the Areas list on the left to rename it to a meaningful name like "header", "sidebar", or "content". Click any area to select it. A conflict warning flashes if you try to draw over an existing area.
- 4Set gap and alignmentDrag the Column Gap and Row Gap sliders in the left panel to set gutter spacing between tracks (0–48px in 4px steps). Use the
justify-itemsandalign-itemsbutton groups to control how child elements align within their grid cells — options are start, end, center, and stretch (default). - 5Select your export formatUse the export tab strip above the code output to switch between CSS, SCSS, Tailwind, React, and HTML. CSS outputs the container with
grid-template-areasand agrid-arearule for each named child. SCSS adds$col-gapand$row-gapvariables. Tailwind generates HTML withgrid-cols-*,col-span-*, androw-start-*utility classes. React generates a full component with an inline styles object. HTML generates a complete standalone file ready to open in a browser. - 6Copy or use the generated codeClick the Copy button at the top right of the code output panel to copy the current export to your clipboard. Paste directly into your project. The code updates live with every change — column edits, area renames, and gap adjustments all reflect instantly in the output without needing to refresh.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Click the Holy Grail preset to load the classic layout: full-width header, three middle columns (sidebar, main, aside), and full-width footer. Or drag areas yourself on the canvas. The generated CSS includes grid-template-areas with the correct ASCII art string and a grid-area rule for each child element.
grid-template-areas lets you name grid regions in CSS by writing quoted rows as "ASCII art": "header header" / "sidebar main" / "footer footer". Each child then uses grid-area: header (or sidebar, main, footer) to position itself. This makes layouts readable and easy to reorganize — just rewrite the template areas string for a different arrangement.
Set a column track to repeat(auto-fill, minmax(280px, 1fr)). This creates as many columns as fit the container at the minimum width, with each column expanding to fill space. On wide screens you might get 4 columns; on mobile, 1 — with no media queries required.
fr (fraction of free space — Grid-exclusive), px (fixed), % (percentage of container), auto (size to content), minmax(min, max) (flexible range). The fr unit is the key to fluid proportional layouts — 3 columns of 1fr each take exactly one-third of available space after fixed tracks are satisfied.
Select the Tailwind tab. The tool generates HTML with grid-cols-{n}, gap-{n}, col-span-{n}, and row-start-{n} utility classes. Custom track sizes use arbitrary value syntax: grid-cols-[200px_1fr_200px]. Copy and paste into any Tailwind project.
Grid is for two-dimensional layouts where you control rows and columns simultaneously — page shells, dashboards, magazine layouts. Flexbox is for one-dimensional distribution — navbars, button groups, centering content. Most UIs use both: Grid for the overall page structure and Flexbox inside individual components.
CSS (grid-template-areas + child grid-area rules), SCSS (with $gap variables), Tailwind HTML (utility classes), React component (inline styles object), and a complete standalone HTML file ready to open in a browser.
Yes — no login, no subscription, no export limits. Everything runs in your browser. Nothing is sent to any server.