Priority summary
A priority region may span columns without changing source order.
<forma-responsive-grid>
Auto-fitting composition grid with optional visual spans that collapse without changing source order.
<forma-responsive-grid>patterns/responsive-grid.htmlThe responsive grid is an auto-fit grid for composing a view from regions of unequal importance. Items fill equal columns sized by a minimum track, and forma-span-2 or forma-span-full let a region take more width when there is room. Emphasis is expressed by space, never by moving the region: the DOM order stays the reading order, and the spans collapse to full width on narrow screens. The application decides which regions exist and which one is emphasized; Forma only places them.
repeat(auto-fit, minmax(min(100%, var(--forma-responsive-grid-min)), 1fr)).min-inline-size: 0, so long content wraps inside its track.forma-span-2 and forma-span-full are general grid helpers: they also work in Grid and other grid containers.The smallest correct markup: the canonical pattern from patterns/responsive-grid.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
A priority region may span columns without changing source order.
Supporting information.
Related actions remain reachable.
<forma-responsive-grid class="forma-component-tag">
<section class="forma-responsive-grid" aria-label="Responsive summary grid">
<article class="forma-surface forma-span-2"><h2>Priority summary</h2><p>A priority region may span columns without changing source order.</p></article>
<article class="forma-surface"><h2>Evidence</h2><p>Supporting information.</p></article>
<article class="forma-surface"><h2>Actions</h2><p>Related actions remain reachable.</p></article>
</section>
</forma-responsive-grid>
Click or tap the code once to select all of it, then copy.
A primary incident summary spans two columns; supporting regions fill the remaining tracks, and a full-width activity log closes the view. Source order is summary, on-call, deployments, activity.
p95 latency is 2.4 s against an 800 ms objective since 09:12 UTC. Payments team is investigating a database lock.
Mateo Alvarez until 18:00 UTC.
3 today, 1 rolled back.
09:40 Rollback of payments-api 7.3.1 completed. 09:18 Incident declared. 09:12 Latency alert fired.
<forma-responsive-grid class="forma-component-tag">
<section class="forma-responsive-grid" aria-label="Operations overview">
<article class="forma-surface forma-span-2" aria-labelledby="responsive-grid-operations-overview-incident">
<h2 id="responsive-grid-operations-overview-incident">Open incident: checkout latency</h2>
<p>p95 latency is 2.4 s against an 800 ms objective since 09:12 UTC. Payments team is investigating a database lock.</p>
</article>
<article class="forma-surface" aria-labelledby="responsive-grid-operations-overview-oncall">
<h2 id="responsive-grid-operations-overview-oncall">On call</h2>
<p>Mateo Alvarez until 18:00 UTC.</p>
</article>
<article class="forma-surface" aria-labelledby="responsive-grid-operations-overview-deploys">
<h2 id="responsive-grid-operations-overview-deploys">Deployments</h2>
<p>3 today, 1 rolled back.</p>
</article>
<article class="forma-surface forma-span-full" aria-labelledby="responsive-grid-operations-overview-activity">
<h2 id="responsive-grid-operations-overview-activity">Recent activity</h2>
<p>09:40 Rollback of payments-api 7.3.1 completed. 09:18 Incident declared. 09:12 Latency alert fired.</p>
</article>
</section>
</forma-responsive-grid>
Click or tap the code once to select all of it, then copy.
A report section with a 12rem minimum track and data-density="compact". More tiles fit per row and the gap tightens; the full-width note still spans the row at every width.
Figures are provisional until the ledger closes on 5 October.
<forma-responsive-grid class="forma-component-tag">
<section class="forma-responsive-grid" data-density="compact" style="--forma-responsive-grid-min: 12rem" aria-label="September report">
<article class="forma-metric-card"><div class="forma-metric-card__label">Revenue</div><div class="forma-metric-card__value">$184,200</div></article>
<article class="forma-metric-card"><div class="forma-metric-card__label">New accounts</div><div class="forma-metric-card__value">312</div></article>
<article class="forma-metric-card"><div class="forma-metric-card__label">Churned</div><div class="forma-metric-card__value">14</div></article>
<article class="forma-metric-card"><div class="forma-metric-card__label">Support tickets</div><div class="forma-metric-card__value">1,048</div></article>
<p class="forma-span-full">Figures are provisional until the ledger closes on 5 October.</p>
</section>
</forma-responsive-grid>
Click or tap the code once to select all of it, then copy.
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
The operations layout at phone width. The two-column span collapses to full width, the minimum track becomes 100%, and every region stacks in source order.
forma-span-2 becomes grid-column: 1 / -1, so the primary region never forces a second track.min-inline-size: 0.<forma-responsive-grid class="forma-component-tag">
<section class="forma-responsive-grid" aria-label="Incident workspace">
<article class="forma-surface forma-span-2" aria-labelledby="responsive-grid-mobile-collapsed-span-summary">
<h2 id="responsive-grid-mobile-collapsed-span-summary">Checkout latency</h2>
<p>Investigating a database lock on the orders table.</p>
</article>
<article class="forma-surface" aria-labelledby="responsive-grid-mobile-collapsed-span-owner">
<h2 id="responsive-grid-mobile-collapsed-span-owner">Owner</h2>
<p>Payments team</p>
</article>
<article class="forma-surface" aria-labelledby="responsive-grid-mobile-collapsed-span-next">
<h2 id="responsive-grid-mobile-collapsed-span-next">Next update</h2>
<p><time datetime="2026-09-30T10:30Z">10:30 UTC</time></p>
</article>
</section>
</forma-responsive-grid>
Click or tap the code once to select all of it, then copy.
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
| Attribute | On | Values | Default | Description |
|---|---|---|---|---|
data-density | .forma-responsive-grid | relaxed | standard | compact | analytical | absent (1rem gap) | Contextual density posture. Sets the gap to 1.5rem, 1rem, or 0.5rem (compact and analytical). Not a data-forma-* hook. |
aria-label | .forma-responsive-grid | string | — | Names the composed region when the grid element is a section. |
aria-labelledby | grid items | id of the item heading | — | Names each article by its visible heading. |
style | .forma-responsive-grid | --forma-responsive-grid-min / --forma-responsive-grid-space | — | Per-instance override of the minimum track or gap. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-responsive-grid | Block class | — | Auto-fit grid container; its direct children get min-inline-size: 0. |
[data-density] | Attribute hook | — | Density posture. relaxed = 1.5rem, standard = 1rem, compact and analytical = 0.5rem gap; overrides --forma-responsive-grid-space. |
--forma-responsive-grid-min | Custom property | default 16rem | Minimum track width before a column drops. Default 16rem; forced to 100% at 30rem viewport width and below. |
--forma-responsive-grid-space | Custom property | default var(--forma-primitive-spacing-4, 1rem) | Gap between tracks and rows. Default --forma-primitive-spacing-4 (1rem). |
.forma-span-2 | Block class | — | Makes an item span two tracks. Becomes full width (1 / -1) at viewport widths of 48rem and below. Only use it where at least two tracks usually fit. |
.forma-span-full | Block class | — | Makes an item span every track at all widths. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves through focusable content in source order. Spans never change focus order. |
Not a form control.
| State | How it is expressed | Presentation |
|---|---|---|
| Wide | viewport above 48rem | Items fill auto-fit columns; forma-span-2 takes two tracks. |
| Medium | viewport at or below 48rem | forma-span-2 becomes full width; other items still auto-fit. |
| Narrow | viewport at or below 30rem | Minimum track is 100%, so every item is full width and stacked. |
| Density posture | data-density attribute | Gap follows the posture. |
min-inline-size: 0.forma-span-2 item can create an empty implicit track; use forma-span-full there or keep spans to wide regions.forma-span-full spans every track at every width, useful for notes and footers of a section.Generated fault-injection specimens expose content, spacing, color-cue, and reduced-effective-contrast risks. They screen presentation robustness as engineering screens without claiming human-subject validation.