Container
A responsive vertical container that keeps its content within the available width.
Design examples
Section titled “Design examples”The container holds a short reading measure as the viewport changes.
<section class="specimen">
<ds-container><ds-text literal size="display">A room for reading</ds-text><ds-gap></ds-gap><ds-text literal wrap>A small collection of essays, field notes and conversations. Take a seat, choose a page and stay a while.</ds-text></ds-container>
</section>
<style>
.specimen { width: 100%; min-width: 0; --cell: calc(20px * var(--sf, 1)); }
.specimen .line { width: 100%; }
.specimen .grow { flex: 1; min-width: 0; }
.specimen .muted { color: var(--ds-text-color-muted); }
.specimen .mono { --ds-typeface-regular: var(--ds-typeface-mono); font-variant-numeric: tabular-nums; }
.specimen .value { width: calc(4 * var(--cell)); text-align: right; }
.specimen .mark { display: inline-flex; align-items: flex-end; width: var(--cell); height: var(--ds-control-height); flex: 0 0 var(--cell); }
.specimen .columns { display: flex; flex-wrap: wrap; gap: var(--cell); }
.specimen .columns > * { min-width: 0; }
.specimen fieldset { border: 0; padding: 0; margin: 0; }
.specimen legend { padding: 0; }
.specimen label { display: flex; align-items: flex-end; gap: calc(var(--cell) / 2); min-height: var(--cell); }
.specimen ds-panel { height: calc(10 * var(--cell)); }
</style> Try it
Section titled “Try it”The container follows the available width and stacks its content.
<ds-container>
<ds-text>First line</ds-text>
<ds-text>Second line</ds-text>
<ds-button primary>Continue</ds-button>
</ds-container> Behaviour
Section titled “Behaviour”The container stacks its default-slot content. At viewport widths above 820px it is centred with a maximum width of 1000px; on smaller viewports it follows the available width. Its children are constrained to the container’s width.
The component has a default slot and no public attributes. There is no size or fluid attribute.