The Quick Stack element in Webflow is one of the fastest and the most powerful ways to build the same kind of production-grade layouts you see from top developers all over the world.
It takes most of the power from CSS grid and from flexbox, and it exposes that power in a direct, visual interface.
In this lesson, we’re gonna talk about the anatomy of a Quick Stack element (how it works), then we’ll add stuff inside so we can build a layout, and then we’ll dig into a really important consideration: when should we use CSS grid or flexbox versus when should we use Quick Stack.
And let’s start there with an intro to Quick Stack. In fact, you can find Quick Stack right in the Add panel, and when you add it to your canvas – there’s a few things to notice.
First, you have presets. When you first add a Quick Stack element, you can apply presets to give you a headstart.
Second and maybe most obvious, is that it sort of looks like a grid. And that’s the secret: that’s all it is by default. But notice how regardless of how many rows or columns we have, a Quick Stack element comes pre-populated with divs already inside, these are the cells. And these cells? They’re just divs set to flex.
So is Quick Stack a top-secret element with proprietary whatever that threatens the very fabric of the internet? No. It’s just a grid filled with divs set to flex. But here's why that’s important.
Whatever you’re doing with Quick Stack, whether you’re using a preset, adding or removing columns, the cells automatically take care of themselves. You don’t have to manually manage the cells. And that takes us to Part 2: adding stuff to a Quick Stack.
At any time, we can drag stuff; we can add whatever we want right inside these cells. No more spinning up a div or a link block or whatever just to group stuff in a cell. And that’s the big point: because you’re not having to manually manage divs, you can do stuff like merge these cells to create essentially whatever layout you want.
And that leads us to Part 3: creating essentially whatever layout you want. Also known as flexbox vs. grid vs. Quick Stack.
So flexbox, put simply, is great for building powerful, one-dimensional layouts. And this is used ALL over the web, and it essentially works like this: you set the display property of a parent element, you set its display to flex. And by doing that, you can now align and justify the children of that flex parent however you want. You can tell that parent element to wrap child elements just like you’d do with maybe a tags layout, and, if you want to break the rules of the parent, you can always apply more properties - this time on a child of the parent. And that way you can get them to override or break those rules.
But that’s flexbox. Then why do we have CSS grid? Grid is generally great for building two-dimensional layouts. If you can draw a grid around it or through it, chances are, it’s pretty straightforward to build it as a grid. In CSS grid, the columns and the rows: these 2 are guides. When you add elements inside a grid, the elements take up the next available cell. But those cells are just guides; there’s not actually anything there, this is different from what we showed in Quick Stack.
In fact, if you do a sort of pros and cons list for grid, the pros are that these guides give you a ton of flexibility for auto layouts, where you want things automatically taking up the next cell. And also for manual layouts, things like overlapping content. And since Grid, just like flex,
since grid is a display property, you can apply it — you can apply grid to things like Collection lists for dynamic data. The cons are you have to manually add divs whenever you want to group content together in a cell, and most layouts need to be built from scratch.
So that’s flexbox and grid – two industry-standard display properties in CSS. Now for Quick Stack. And even though Quick Stack is combining the power of flexbox and grid into one thing, it’s not a display property; it’s an element made up of other elements. And that’s the key to why this is a big shortcut. Most layouts call for this type of setup.
Apple does this all the time. The parent element here is a grid, and each of these “cells”? They’re divs set to flex. That’s exactly what Quick Stack preconfigures by default.
So when experimenting with Quick Stack, chances are, you’ll see a pretty dramatic increase in the speed with which you can develop layouts.
So when you look at all these layouts here, they may look like a great candidate for flex, which by the way they are. These might look like a great candidate for grid, which they are. But a lot of these can also be built faster with Quick Stack.
And if you’re looking for a best practice, it helps to start most of these 2-dimensional layouts with Quick Stack. You can always build a lot of these 1-dimensional layouts using flex; you can even use the V flex and H flex layout elements which are just divs that already have that direction set.
But when you’re looking to push the boundaries a bit further, or if you have a specialized layout that requires something like CSS grid? That’s when to dig deep there.
Put simply: all these options? You can often build the same thing many different ways and that’s a huge advantage to learning visual development or code. But by unlocking some of these shortcuts, particularly in Quick Stack, you’re much better equipped to build production-grade layouts faster and more efficiently than ever before.
But that’s an overview of Quick Stack in Webflow.