Skip to content
LSD Framework
LSD primitive · context-driven responsive

Container Query Playground

Drag the handle. Watch a card morph through three breakpoints without ever resizing the page. The viewport is a context — one of many. LSD treats @container as a first-class citizen because a component should respond to where it lives, not where the user's browser ends.

container-type: inline-size @container cqp · 360 / 620 ↩ All components
01 · Drag the handle · watch it morph3 breakpoints
px
Aurora · keyframe 03

Card adapts to its container.

Same DOM. Same CSS. Layout, type scale, and visible actions all flex with the parent — never the viewport.

base · stacked @container cqp (min-width: 360px) @container cqp (min-width: 620px)
02 · Compare · container query vs media querysame DOM
Container · @container cqppasses ✓

Resizes with its parent. Works inside grids, drawers, anywhere.

Viewport · @mediabrittle ✗

Only sees window width. Place this card in a half-width column and the breakpoint lies.

UsageAPI surface

Authoring contract

Set container-type: inline-size + container-name on the host, then declare style rules under @container <name> (min-width: …). Children read the container's inline size, not the viewport. Drop the component into a 320px sidebar or a 1200px main column — it adapts.

HookValuesEffect
container-typeinline-size · size · normalEstablish a query container on the parent.
container-nameidentTarget a specific container in nested setups.
@container <name> (…)any size featureApply rules when the container matches.
cqi / cqw units1cqi = 1% container inline-sizeTypography that scales to its container.
JS eventcqp:resizeFires with detail.width (px).
prefers-reduced-motionMorph transitions removed; layout still updates.
View HTML
<div class="lsd-cqp__pane" style="container-type: inline-size; container-name: cqp;">
  <div class="lsd-cqp__card">
    <div class="lsd-cqp__card-thumb"></div>
    <div class="lsd-cqp__card-body">…</div>
  </div>
  <div class="lsd-cqp__handle"></div>
</div>

@container cqp (min-width: 620px) {
  .lsd-cqp__card { grid-template-columns: 240px 1fr; }
}
LSD components · Container Query Playground · primitive
↩ All components