Interactive demo
Layout decision helper
Choose between Grid, Flexbox, Subgrid, and container queries based on the behavior the component needs.
CSS used in this demo
.tool {
display: grid;
gap: 1.25rem;
max-width: 48rem;
margin: 0 auto;
padding: 1.5rem;
}
.tool h1 {
margin: 0;
font-size: 2rem;
line-height: 1.1;
}
form {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
label {
display: grid;
gap: 0.35rem;
font-weight: 700;
}
select {
min-height: 2.75rem;
border: 2px solid #171717;
border-radius: 6px;
background: #ffffff;
padding-inline: 0.75rem;
}
.result {
display: grid;
gap: 0.5rem;
border: 2px solid #171717;
border-radius: 8px;
background: #e8f3f3;
padding: 1.25rem;
}
.result__label {
color: #0a6a6c;
font-size: 0.78rem;
font-weight: 800;
text-transform: uppercase;
}
.result h2 {
margin: 0;
font-size: 2.4rem;
line-height: 1;
}
What this demo is for
Use this demo when a layout problem feels like a tool choice but the real question is the relationship between the content pieces.
Try this
- Switch the primary relationship between one-axis and two-axis layouts and watch how the recommendation changes.
- Set the content risk to dense to see when a simple row of flexible items becomes a stronger Grid candidate.
- Use the recommendation as a starting point, then check whether any child still needs intrinsic sizing constraints.
Related guides