We’ve talked so much about Masonry format right here on CSS-Tips, so there’s no have to remind you of the two-sided discussions about the best way to strategy it, the concept of utilizing it as a brand new unifying format idea, or various approaches for making it work at present.
Right here’s what you do have to know: it’s going to be show: grid-lanes.

The earliest talks regarding masonry started in 2017 when Rachel Andrew expressed some considerations about the best way to make a Pinterest masonry format. Rachel stated it felt like the proper strategy needs to be a flexbox form of factor, however this wasn’t totally achievable with flexbox, as objects would somewhat circulate from top-to-bottom somewhat than throughout every row:
Presently the closest you will get with CSS to one of these format is to make use of
multi-colnevertheless, the objects then circulate prime to backside somewhat than throughout the rows.This feels extra like a behaviour of flexbox than grid, as the answer may be very a lot based mostly on the scale of the objects. Opening this to be able to file the function request/use case for future dialogue.
And so, the talks surrounding masonry format in CSS started inside the W3C. In that very same GitHub thread, you’ll learn that Tab Atkins-Bittner shared a “hacky” approach to go about it with CSS Grid.
You may have Grid do Masonry if you understand the heights of the objects forward of time. It’s a bit hacky, however you set the grid container to
grid: auto-flow dense 1px /, then set every merchandise to grid-row: span; (for instance, if the merchandise is 50px tall, use; grid-row: span 50;).
I’m a sucker for intelligent CSS hacks, however you understand what else I’m a sucker for? A working CSS answer that makes it simpler for inexperienced persons to make use of. And no, sadly, we can not use grid-template-rows or grid-template-columns, as Nate Inexperienced urged in the identical thread:
.figure-list {
show: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: circulate;
}
There’s no “easy” approach to adapt Grid into Masonry – something would contain non-trivial edits to the format algorithm. Packery, particularly, actually wants issues to have an outlined width.
Okay, that’s wonderful. I’m certain you’d be pondering as nicely, “why not create a brand new show property for it?” Properly, Rachel added that:
The factor is we will’t create a model new worth of show for each distinct design sample.
Thoughts you, all these discussions have been taking place way back to 2017, that means masonry has been an elusive objective for fairly a while.
Simply to ensure you’re with me, that is an instance picture of the form of format masonry appears like (due to Michael Richins for this):

One factor I would really like is that previous to the announcement of masonry show sort, there have been options/hacks mentioned, like this one from Andy Barefoot, however nothing actually was determined as the principle go-to function for CSS masonry. Hey, there was even an excellent cool Masonry library from David DeSandro, and he gave fairly helpful recommendation to W3C and browser distributors when writing the spec and implementing the masonry format, like on how loading photographs would work, multi-column spanning objects, filling gaps, retaining horizontal order.
Try the Masonry.js docs for extra details about the thing choices.
This thread helped, nevertheless it nonetheless didn’t result in a conclusive assertion about what the masonry syntax will appear to be. Actually, we had code solutions, like from Dan Tonon:
.flex-container {
show: flex;
flex-direction: column;
flex-block-count: 2;
flex-block-flow: cross;
}
This introduces two new flexbox properties referred to as flex-block-count and flex-block-flow which permits us to regulate objects equally (with column-count) and management the circulate of things, respectively. Nonetheless, this wouldn’t fly as Michael Richins identified:
It will nonetheless not work for youngsters of various top…
This thread was not going wherever, so discussions led to April 2020 with a GitHub person with the title Nic787 referencing and agreeing with an earlier possible answer for masonry utilizing float as an alternative of grid.
I believe you’ve a very good level. Presently, float is changing into previous and flexbox enable lots of issues to be accomplished, however this masonry format is missing in each.
… Typically you possibly can have lot of small photographs in a row, so making it left to proper can’t work on a regular basis. Masonry is left to proper like all the time, however in a means it’s simpler for the person to entry informations.
Thankfully, discussions nonetheless continued in lots of threads, and the requests for the masonry show property flooded W3C. One other notable GitHub thread that surfaced on the masonry debate is, nicely, the Masonry Syntax Debate in November 2024, however that additionally didn’t result in a lot at that time. Actually, Jen Simmons famous within the assembly that:
Personally dissatisfied that we’re not making extra progress. We’ve been having this argument for five years.
5 years of backwards and forwards on how precisely the naming and construction could be. Will we use grid? Will we use a model new property? Will we create separate properties only for masonry? We couldn’t actually resolve on that.
One factor I prefer to get behind is a remark from our very personal Juan Diego, stating how options aren’t “simply use grid” or create a brand new property, however that we may eliminate the grid- prefix altogether and accept an possibility that caters for each grid and masonry:
…it needs to be attainable to make use of a brand new unprefixed
template-areasproperty for masonry and grid, whatever the formatting context..
Thankfully, one thing good got here out of that thread as a result of one other assembly was held on January thirty first of 2025, and guess what? It was resolved to reuse grid templating and placement properties for masonry format.
The CSS Working Group simply mentioned
[css-grid-3][masonry] Masonry Syntax Debate, and agreed to the next: RESOLVED: Re-use grid templating and placement properties for masonry format.
Wait. Why am I saying about masonry syntax properties? What about the principle syntax itself? Isn’t that why we’re right here? Superior, you’re nonetheless with me. So let me present you the precise thread the place the masonry syntax warfare ended.
It’s (virtually) right here!
This brings us to the newest announcement that setting grid-lanes on the show property prompts a masonry format.
.masonry {
show: grid-lanes;
}
It was powerful to get right here. Deciding on the key phrase alone took years. Simply take a look at the entire names that have been thought of main as much as grid-lanes:
collapsed-gridorgrid collapsegrid-stackorstacked-gridgrid-packorpacked-gridorgrid packcompact-gridorcompact gridgrid-masonryormasonry-gridgrid-flexorflex-gridgrid single-axis(masonry grid) vs.grid dual-axis(regular grid)grid stack(masonry grid) vs.grid grid(regular grid)staggered-gridorgrid staggereduneven-gridsemi-gridlane-gridorgrid-lanesaxial-grid
I wouldn’t have minded staggered-grid since that’s what it’s in React Native. Actually, Kevin Powell agreed. That stated, I’m completely okay with grid-lanes. It’ll take a while for browsers to implement it, as discussions surrounding the shorthand changes for masonry are nonetheless happening, with nothing a lot stated on the difficulty simply but.
What about Merchandise Circulation?
Oh yeah, do not forget that? It’s nonetheless within the works, and I count on that we’ll see it after a correct grid-lanes implementation begins making the rounds. There’s a pleasant hypothetical instance from Fantasai illustrating the way it may look if added to the spec at present:
item-flow: || || ||
/* shorthand for */
item-direction: row | column | row-reverse | column-reverse
item-wrap: wrap | wrap-reverse
item-pack: regular | dense || collapse
item-slack:
In use, it will look one thing alongside the traces of:
.masonry {
show: grid;
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
item-flow: collapse; /* == item-flow: row collapse 1em; */
hole: 1rem;
}
So, what’s subsequent?
After many back-and-forths, masonry grid-lanes is right here! However the place precisely?
Properly, that is the awkward half. The reality is we’ll nonetheless have to attend for browsers to implement grid-lanes. How lengthy could it take? I actually can’t say, however consider that every one main browsers have already got carried out some sort of masonry format behind flags or previews, however with totally different syntaxes:
So, excellent news throughout! All that’s left is to attend. If you wish to monitor grid-lanes progress, right here is an effective hyperlink pool for every browser from Patrick Brosset. And, should you can’t await the official masonry implementation, Zell Liew has an strategy for utilizing it at present, with minimal JavaScript.








