CSS Grid Generator
Drag grid areas, copy the code.
At a glance
- Input:
- CSS
- Processing:
- Runs locally in your browser
- Privacy:
- Nothing you type is sent to a server
Last updated: 2026-11-15
Common use cases
- Sketching a Holy Grail page layout — header, nav, main, aside, footer — without writing grid code by hand
- Prototyping a dashboard with a sidebar, header, stats row and content area
- Building a card grid for a product listing and copying the Tailwind classes into a component
- Handing a React developer a pasteable GridLayout component with the areas already wired up
About this tool
Drag across the canvas to draw named grid areas, or start from a preset — Holy Grail, dashboard, card grid, blog and more. Set the columns, rows and gap, rename areas in place, then copy the CSS, a Tailwind div or a React component. Live preview, no upload, no signup.
How to use it
- Pick a preset, or drag across the canvas to draw your own named area — drawing over an area replaces it.
- Set the columns, rows and gap with the sliders, and rename the selected area in the list.
- Watch the canvas update live as you draw — every area is a real grid cell in the preview.
- Copy the CSS, Tailwind or React code from the export panel.
Worked examples
Input: Holy Grail preset, 3 columns × 3 rows
Output: grid-template-areas: "header header header" "nav main aside" "footer footer footer";
The classic page layout — header and footer span the full width, nav, main and aside share the middle row.
Input: Card grid preset, 3 columns × 2 rows
Output: grid-template-areas: "card-1 card-2 card-3" "card-4 card-5 card-6";
Six equal cards — the fastest way to lay out a product listing or photo gallery.
Input: Holy Grail preset, Tailwind export
Output: [grid-template-areas:'"header_header_header"_"nav_main_aside"_"footer_footer_footer"']
The same layout as a Tailwind arbitrary value — paste the div into any component (Tailwind v3.3+).
Practical tips
- Name areas after what they hold (header, main, sidebar) — the names become the CSS identifiers and the React labels.
- Drawing over an area replaces it, so you can redraw a whole row in one drag instead of deleting first.
- Keep the gap at 16px for page layouts and 8px for dense card grids — the gap is part of the exported code.
- For a single-column mobile layout, reuse the same area names stacked in one column inside a media query.
Common mistakes
- Reusing one area name for two different rectangles — grid-template-areas needs each name to form a single rectangle; the editor refuses duplicate names.
- Drawing an L-shaped area — a named area must be a rectangle, so the editor replaces whatever the drag touches instead of merging it.
- Expecting the Tailwind export to work on old Tailwind — arbitrary values need v3.3 or newer; on older versions use the CSS export instead.
- Forgetting the gap is in the code — a layout that looks right on the canvas will look tighter on the page if you strip the gap line when pasting.
How this compares
Most grid tools in the field are English-only single-purpose pages — the best of them already ship drag-to-draw areas, presets and Tailwind export, and this one matches that set rather than claiming it as new. Its edge is the same as every gargloo tool: four languages from day one, no account, no upload. The tradeoff: one layout at a time with no breakpoint editor — for per-breakpoint layouts, adapt the exported CSS in a media query.
Good to know
- Grid only — no flexbox mode; a flexbox row or column belongs in a flexbox tool, not here.
- 1–6 columns and 1–6 rows; very large grids belong in a design tool, not a generator.
- One layout per export — no breakpoint editor; responsive variants are hand-edited media queries around the exported CSS.
- Area names must be valid CSS identifiers — spaces become hyphens and duplicate names are refused.
Frequently asked questions
What is a CSS grid area?
A named rectangle in a grid — header, sidebar, main — that you place with grid-template-areas. Instead of counting rows and columns by hand, you draw the layout as a map of names: "header header header" puts the header across the whole top row. Each named element then gets grid-area: header in CSS.
Does the generated CSS work in all browsers?
Yes — CSS grid and grid-template-areas work in all modern browsers (Chrome, Edge, Firefox, Safari). The output is plain CSS with no dependencies, so you can paste it into any stylesheet, and the React export uses inline styles that work the same way.
How do I use the layout in Tailwind?
Switch the export to Tailwind and copy the div. The container uses grid-cols / grid-rows / gap utilities plus an arbitrary [grid-template-areas:'...'] value, and each area gets a [grid-area:name] class. Arbitrary values need Tailwind v3.3 or newer — no config file changes.
Can I make a responsive layout?
The generator builds one layout at a time — the code it gives you is the desktop layout. For responsiveness, paste the CSS into a media query and change the template: for example, stack the areas into a single column under 640px by writing grid-template-areas: "header" "main" "sidebar" "footer".
Is my layout uploaded anywhere?
No. The canvas, the presets and all three exports run entirely in your browser — nothing you draw or copy leaves this tab.

