Containers
The constraint that stops content spreading to unusable widths, and increasingly the unit that components respond to.
Definition
A container bounds content width and provides consistent horizontal padding. With container queries, containers also become the reference for component-level responsive behaviour, replacing viewport assumptions.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this page
Container widths by content type
| Content | Max width | Reason |
|---|---|---|
| Continuous prose | 60 to 70ch, about 640 to 720px | Readable measure. |
| Marketing pages | 1100 to 1280px | Room for imagery and multi-column sections. |
| Application shells | Full width | Tools use available space; content columns are constrained inside. |
| Data tables | Full width with horizontal scroll | Truncating columns is worse than scrolling. |
| Forms | 480 to 640px | Single column, comfortable field width. |
Container queries
.card-host { container-type: inline-size; container-name: card; }
.card { display: grid; gap: var(--space-3); }
@container card (min-width: 28rem) {
.card {
grid-template-columns: 8rem 1fr;
align-items: start;
}
}The component adapts to the space it is actually in, which makes it reusable in a sidebar and in a wide grid without variants.
In practice
Reusable card without variants
Design systemsOne card component that reflows based on its own width replaces a family of size variants and the documentation explaining when to use each.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
MDN Web Docs
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Short definition
The one-paragraph version, for when that is all you need.
- BreakpointTerm
- Container QueryTerm
- MeasureTerm
- Responsive DesignTerm
Related concept
Connected closely enough to change how you apply this.
- Reflow and ZoomAccessibility
- Component API DesignDesign system
- BreakpointsUI foundation
- ColumnsUI foundation
- Common RegionUI foundation
- CompositionUI foundation
- GridsUI foundation
- ReadabilityUI foundation
- Responsive LayoutUI foundation
- Responsive TypographyUI foundation