MyDraftGrid

CSS Grid generator & responsive layout builder

Sketch a layout, tune it for every screen, and copy production-ready CSS.

Quick start Pick a template → check Mobile → copy CSS.

header
sidebar
stat-a
stat-b
stat-c
chart
activity
table

Drag to move · corner to resize · Tab to an area, then arrows / Shift+arrows.

/* Mobile first (base) */
.grid {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(64px, auto));
  gap: 12px;
  padding: 12px;
  grid-template-areas:
    "header"
    "sidebar"
    "sidebar"
    "stat-a"
    "stat-b"
    "stat-c"
    "chart"
    "chart"
    "activity"
    "activity"
    "table";
}
.grid__header { grid-area: header; }
.grid__sidebar { grid-area: sidebar; }
.grid__stat-a { grid-area: stat-a; }
.grid__stat-b { grid-area: stat-b; }
.grid__stat-c { grid-area: stat-c; }
.grid__chart { grid-area: chart; }
.grid__activity { grid-area: activity; }
.grid__table { grid-area: table; }

@media (min-width: 641px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(80px, auto));
    gap: 16px;
    padding: 20px;
    grid-template-areas:
      "header header header header header header"
      "sidebar sidebar sidebar sidebar sidebar sidebar"
      "stat-a stat-a stat-b stat-b stat-c stat-c"
      "chart chart chart chart chart chart"
      "chart chart chart chart chart chart"
      "chart chart chart chart chart chart"
      "activity activity activity activity activity activity"
      "activity activity activity activity activity activity"
      "table table table table table table"
      "table table table table table table";
  }
  .grid__header { grid-area: header; }
  .grid__sidebar { grid-area: sidebar; }
  .grid__stat-a { grid-area: stat-a; }
  .grid__stat-b { grid-area: stat-b; }
  .grid__stat-c { grid-area: stat-c; }
  .grid__chart { grid-area: chart; }
  .grid__activity { grid-area: activity; }
  .grid__table { grid-area: table; }
}

@media (min-width: 1025px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(80px, auto));
    gap: 24px;
    padding: 24px;
    grid-template-areas:
      "header header header header header header header header header header header header"
      "sidebar sidebar stat-a stat-a stat-a stat-a stat-b stat-b stat-b stat-c stat-c stat-c"
      "sidebar sidebar chart chart chart chart chart chart chart activity activity activity"
      "sidebar sidebar chart chart chart chart chart chart chart activity activity activity"
      "sidebar sidebar chart chart chart chart chart chart chart activity activity activity"
      "sidebar sidebar table table table table table table table table table table";
  }
  .grid__header { grid-area: header; }
  .grid__sidebar { grid-area: sidebar; }
  .grid__stat-a { grid-area: stat-a; }
  .grid__stat-b { grid-area: stat-b; }
  .grid__stat-c { grid-area: stat-c; }
  .grid__chart { grid-area: chart; }
  .grid__activity { grid-area: activity; }
  .grid__table { grid-area: table; }
}

How to build a layout

  1. 1Start from a template. Pick Dashboard, Gallery, Card grid or Portfolio, or press Reset for the default.
  2. 2Shape the grid. Set columns, rows, gap, margin and row height. Each breakpoint keeps its own settings.
  3. 3Place your areas. Drag areas to move them and pull the corner to resize. Rename them — names become grid-template-areas.
  4. 4Check every screen. Switch Desktop, Tablet and Mobile, or open Compare to see all three side by side.
  5. 5Export. Copy the CSS, download a complete HTML page, save a preset, or share a link.

FAQ

+Is MyDraftGrid free?

Yes. The generator runs entirely in your browser with no account, and the code you export is yours to use anywhere.

+Where are my saved presets stored?

In your browser's local storage on this device. Nothing is uploaded. Clearing site data removes them, so export JSON for backups.

+Why does the CSS sometimes use line numbers instead of area names?

grid-template-areas can't describe overlapping areas. When two areas overlap at a breakpoint, MyDraftGrid switches that breakpoint to grid-area line numbers so the result stays correct.

+What breakpoints are used?

The CSS is mobile-first: the mobile layout is the base, tablet applies from 641px and desktop from 1025px. Adjust the media queries to match your project.

+Does a share link send my layout to a server?

No. The layout is encoded in the part of the URL after #, which browsers don't send to servers. Anyone with the link sees the same layout.

+Can I use it with a keyboard or on my phone?

Yes. Tab to an area, use arrow keys to move it and Shift+arrows to resize. On touch screens, drag areas and their corner handles directly.