Build a CSS Grid or Flexbox layout visually — set the number of columns and
the gap between items, watch the preview update live, then copy the exact display: grid /
display: flex CSS or the equivalent Tailwind layout utility classes.
Set display: grid and grid-template-columns (e.g. repeat(3, 1fr)) on the container, plus an optional gap. This generator builds that CSS from a columns slider with a live preview.
Set display: flex on the container along with flex-wrap and gap. This generator produces the equivalent Flexbox CSS alongside the Grid option.
Grid is two-dimensional (rows and columns at once) and best for overall page/section layout; Flexbox is one-dimensional (a single row or column) and best for aligning items within a component.
The CSS gap property sets spacing between items in both Grid and Flexbox without needing manual margins. Adjust it with the gap slider here.
A common pattern is 1 column on mobile, 2–3 on tablet, and 3–4+ on desktop — combine this generator’s output with a media query or CSS auto-fit/minmax() for full responsiveness.
Yes. Toggle Tailwind mode to get the equivalent grid-cols-*/flex/gap-* utility classes instead of raw CSS.
Yes — completely free with no sign-up, and it runs entirely in your browser.
Yes, toggle the light/dark preview to check spacing and contrast in both themes.