Flexbox Generator
The one-dimensional layout tools for smaller groups.
Set the column count and gap, watch the rows lay themselves out, and copy the display: grid block that matches.
grid-template-columns: repeat(N, 1fr) — equal, responsive columns.
Grid positions children in rows and columns simultaneously. grid-template-columns defines the column track; grid-template-rows does the same for rows when you need fixed heights.
Children are placed into cells left-to-right, top-to-bottom automatically. As the column count changes, items reflow into new rows — exactly what you want for galleries and dashboards.
Instead of margins on every child, one gap declaration spaces all tracks. Change it once in the preview and the whole grid breathes.
Grid when you control both axes — galleries, dashboards, page layouts. Flexbox when it's a single row or column of items. The rule of thumb: flex is one-dimensional, grid is two-dimensional.
fr is a fractional unit of free space. repeat(3, 1fr) gives three equal columns that share all available width and adapt when the container resizes.
gap adds even spacing between rows and columns without needing margins — the modern replacement for the old gutter hacks, and it works on everything.