Component-first responsive card
Container queries react to the component width itself, not the whole viewport. Perfect for cards inside sidebars, CMS blocks, and nested layouts.
Container Query Playground in Jwala Baheliya's frontend toolkit. A live responsive utility with copy-ready output and in-browser previews.
The left rail keeps navigation nearby, the right rail keeps your reading position visible, and the live tool stays front and center once you are ready to use it.
Container Query Playground is for checking how interfaces adapt across devices, widths, and breakpoints before you ship them.
If you are not sure where to start, use the live controls below, watch the preview change, and copy the result only when it matches what you want in your project.
Interactive, client-side, and still running directly inside this docs page.
Container queries react to the component width itself, not the whole viewport. Perfect for cards inside sidebars, CMS blocks, and nested layouts.
.cq-demo {
container: toolkit-card / inline-size;
width: min(100%, 420px);
margin-inline: auto;
}
.cq-card {
display: grid;
gap: 20px;
padding: 18px;
border-radius: 24px;
color: #f8fafc;
background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(15,23,42,0.9));
border: 1px solid rgba(56,189,248,0.18);
box-shadow: 0 24px 80px -36px rgba(15, 23, 42, 0.72);
}
.cq-media {
min-height: 176px;
border-radius: 16px;
background:
radial-gradient(circle at 20% 20%, rgba(56,189,248,0.18), transparent 36%),
linear-gradient(140deg, #38bdf822, transparent 65%),
#020617;
}
.cq-actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.cq-stats {
display: grid;
gap: 12px;
}
@container toolkit-card (min-width: 640px) {
.cq-card {
grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
align-items: center;
}
.cq-stats {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}<section className="cq-demo">
<article className="cq-card">
<div className="cq-copy">
<p className="cq-kicker">Modern CSS API</p>
<h3>Component-first responsive card</h3>
<p>Container queries react to the component width itself, not the whole viewport. Perfect for cards inside sidebars, CMS blocks, and nested layouts.</p>
<div className="cq-actions">
<button>Primary action</button>
<button>Secondary action</button>
</div>
</div>
<div className="cq-media" />
</article>
</section>More tools from the same category, so you can keep moving without going back to the full index.