VERIFICATION-0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
| Capability | Standard | Advanced |
|---|---|---|
| Evidence history | 30 days | Unlimited |
| Exports | Manual | Automated |
<forma-comparison-grid>
Preserves cross-item comparison relationships in a bounded two-dimensional surface.
<forma-comparison-grid>patterns/comparison-grid.htmlA comparison grid is a native table with items as columns and attributes as row headers, inside a focusable, labelled region that scrolls horizontally when the table is wider than its container. The table is sized to its content (min-inline-size: max-content), so columns are never squeezed or recomposed: reading across a row always compares the same attribute. Forma provides the bounded surface and cell spacing; the application supplies the items, attributes and wording, including explicit Not included and Unknown cells.
overscroll-behavior-inline: contain, so a sideways swipe does not scroll the page.min-inline-size: max-content: columns take the width their content needs.The smallest correct markup: the canonical pattern from patterns/comparison-grid.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
| Capability | Standard | Advanced |
|---|---|---|
| Evidence history | 30 days | Unlimited |
| Exports | Manual | Automated |
<forma-comparison-grid class="forma-component-tag">
<div class="forma-comparison-grid" role="region" aria-label="Plan comparison" tabindex="0">
<table>
<caption>Plan comparison</caption>
<thead><tr><th scope="col">Capability</th><th scope="col">Standard</th><th scope="col">Advanced</th></tr></thead>
<tbody><tr><th scope="row">Evidence history</th><td>30 days</td><td>Unlimited</td></tr><tr><th scope="row">Exports</th><td>Manual</td><td>Automated</td></tr></tbody>
</table>
</div>
</forma-comparison-grid>
Click or tap the code once to select all of it, then copy.
Three support tiers. Missing capabilities say Not included, and a value the vendor has not published says Unknown, so an empty cell never has to be interpreted.
| Capability | Basic | Business | Enterprise |
|---|---|---|---|
| First response | 2 business days | 8 hours | 1 hour |
| Phone support | Not included | Business hours | 24 × 7 |
| Named engineer | Not included | Not included | Included |
| Uptime commitment | None | 99.9% | Unknown: contract specific |
<forma-comparison-grid class="forma-component-tag">
<div class="forma-comparison-grid" role="region" aria-label="Support tier comparison" tabindex="0">
<table>
<caption>Support tier comparison</caption>
<thead><tr><th scope="col">Capability</th><th scope="col">Basic</th><th scope="col">Business</th><th scope="col">Enterprise</th></tr></thead>
<tbody>
<tr><th scope="row">First response</th><td>2 business days</td><td>8 hours</td><td>1 hour</td></tr>
<tr><th scope="row">Phone support</th><td>Not included</td><td>Business hours</td><td>24 × 7</td></tr>
<tr><th scope="row">Named engineer</th><td>Not included</td><td>Not included</td><td>Included</td></tr>
<tr><th scope="row">Uptime commitment</th><td>None</td><td>99.9%</td><td>Unknown: contract specific</td></tr>
</tbody>
</table>
</div>
</forma-comparison-grid>
Click or tap the code once to select all of it, then copy.
Five vendors across four attributes is wider than most containers. The table keeps every column at its content width and the region scrolls sideways within its own bounds instead of widening the page. The row headers stay first in each row so every value can be traced to its attribute.
| Attribute | Northline Freight | Baltic Carriers | Rhein Logistik | Atlas Shipping Group | Coastal Haulage |
|---|---|---|---|---|---|
| Rate per pallet | €142 | €128 | €151 | €119 | €135 |
| Transit, Rotterdam to Lyon | 3 days | 4 days | 2 days | 5 days | 3 days |
| Customs brokerage | Included | Extra charge | Included | Not offered | Extra charge |
| Insurance limit | €250,000 | €100,000 | €500,000 | Unknown | €250,000 |
<forma-comparison-grid class="forma-component-tag">
<div class="forma-comparison-grid" role="region" aria-label="Freight vendor comparison" tabindex="0">
<table>
<caption>Freight vendor comparison, Q4 quotes</caption>
<thead>
<tr><th scope="col">Attribute</th><th scope="col">Northline Freight</th><th scope="col">Baltic Carriers</th><th scope="col">Rhein Logistik</th><th scope="col">Atlas Shipping Group</th><th scope="col">Coastal Haulage</th></tr>
</thead>
<tbody>
<tr><th scope="row">Rate per pallet</th><td>€142</td><td>€128</td><td>€151</td><td>€119</td><td>€135</td></tr>
<tr><th scope="row">Transit, Rotterdam to Lyon</th><td>3 days</td><td>4 days</td><td>2 days</td><td>5 days</td><td>3 days</td></tr>
<tr><th scope="row">Customs brokerage</th><td>Included</td><td>Extra charge</td><td>Included</td><td>Not offered</td><td>Extra charge</td></tr>
<tr><th scope="row">Insurance limit</th><td>€250,000</td><td>€100,000</td><td>€500,000</td><td>Unknown</td><td>€250,000</td></tr>
</tbody>
</table>
</div>
</forma-comparison-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.
Three releases compared on a phone. The table keeps its shape and the region scrolls horizontally; nothing collapses.
overscroll-behavior-inline: contain keeps a sideways swipe inside the grid instead of scrolling the page or triggering back navigation.tabindex="0"), so keyboard and switch users can scroll it; it shows a 2px outline when focused.<forma-comparison-grid class="forma-component-tag">
<div class="forma-comparison-grid" role="region" aria-label="Release comparison" tabindex="0">
<table>
<caption>Release comparison</caption>
<thead><tr><th scope="col">Check</th><th scope="col">2026.08</th><th scope="col">2026.09</th><th scope="col">2026.10 candidate</th></tr></thead>
<tbody>
<tr><th scope="row">Tests</th><td>Passed</td><td>Passed</td><td>2 failing</td></tr>
<tr><th scope="row">Security review</th><td>Complete</td><td>Complete</td><td>Not started</td></tr>
</tbody>
</table>
</div>
</forma-comparison-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 |
|---|---|---|---|---|
role | .forma-comparison-grid | region | — | Makes the scroll container a named landmark. |
aria-label | .forma-comparison-grid | string | — | Names the region, usually the same as the table caption. |
tabindex | .forma-comparison-grid | 0 | — | Lets keyboard users focus and scroll the region. |
scope | th | col | row | — | col on item headers, row on attribute headers, so each cell is announced with both. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-comparison-grid | Block class | — | The bounded scroll region around the native table: horizontal overflow, inline overscroll containment and a focus outline. The inner table is sized to max-content and its cells are padded, start-aligned and top-aligned. |
| Keys | Result |
|---|---|
| Tab | Focuses the region. |
| Arrow keys | Scroll the focused region natively. There is no cell navigation. |
Not a form control.
| State | How it is expressed | Presentation |
|---|---|---|
| Fits | table width ≤ region width | The table fills the region at full width. |
| Overflowing | table wider than the region | The region scrolls horizontally; the page does not. |
| Focused | :focus-visible on the region | 2px outline in the current text color, offset by 2px. |
| Not included / Unknown cell | application text | Stated in words; no special styling. |
caption, scope on every header, and a matching aria-label on the region.max-content; keep cell text short or insert natural break points.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.