Vendor agreement, draft 3
Section 7 now limits liability to twelve months of fees. Section 9 adds a 30-day termination notice for convenience.
<forma-priority-stack>
Responsive composition where priority changes space allocation but never DOM or semantic order.
<forma-priority-stack>patterns/priority-stack.htmlA priority stack places a small number of regions in a wrapping row. Each region wants at least 18rem; the region marked data-priority="primary" grows twice as fast as the others, so it takes most of the extra width when there is room. When the row cannot fit the regions at their minimum, they wrap and eventually stack, always in source order. Priority is therefore expressed as space, not as position. The application decides which region is primary for the current task.
The smallest correct markup: the canonical pattern from patterns/priority-stack.html inside its public tag. Copy this first, then adapt labels, names and state. This component owns a page's main landmark, so it renders in its own document below.
Rendered from the canonical pattern file.
<forma-priority-stack class="forma-component-tag">
<section class="forma-priority-stack" aria-label="Responsive priority composition">
<main class="forma-surface" data-priority="primary"><h2>Primary task</h2><p>Receives more space when available and stacks first when space contracts.</p></main>
<aside class="forma-surface"><h2>Supporting context</h2><p>Secondary context remains in semantic order.</p></aside>
</section>
</forma-priority-stack>
Click or tap the code once to select all of it, then copy.
A document under review is primary; the reviewer checklist supports it. On a wide screen the document gets roughly two thirds of the row. The document is first in the source, so it is also first when stacked.
Section 7 now limits liability to twelve months of fees. Section 9 adds a 30-day termination notice for convenience.
<forma-priority-stack class="forma-component-tag">
<div class="forma-priority-stack">
<article class="forma-surface forma-stack" data-priority="primary" aria-labelledby="priority-stack-review-workspace-doc">
<h2 id="priority-stack-review-workspace-doc">Vendor agreement, draft 3</h2>
<p>Section 7 now limits liability to twelve months of fees. Section 9 adds a 30-day termination notice for convenience.</p>
</article>
<aside class="forma-surface forma-stack" data-density="compact" aria-labelledby="priority-stack-review-workspace-checklist">
<h2 id="priority-stack-review-workspace-checklist">Review checklist</h2>
<label class="forma-checkbox">
<input class="forma-checkbox__input" type="checkbox" name="priority-stack-review-workspace-liability" value="done" checked>
<span class="forma-checkbox__box" aria-hidden="true"></span>
<span class="forma-checkbox__text"><span class="forma-checkbox__label">Liability cap reviewed</span></span>
</label>
<label class="forma-checkbox">
<input class="forma-checkbox__input" type="checkbox" name="priority-stack-review-workspace-termination" value="done">
<span class="forma-checkbox__box" aria-hidden="true"></span>
<span class="forma-checkbox__text"><span class="forma-checkbox__label">Termination terms reviewed</span></span>
</label>
</aside>
</div>
</forma-priority-stack>
Click or tap the code once to select all of it, then copy.
Two supporting regions and a primary region under data-density="compact". The alert summary is written first because it must be read first; the primary work area still gets the most space when the row fits.
2 shipments delayed by weather.
18 orders ready to assign. Oldest waiting 42 minutes.
11 available, 4 on break.
<forma-priority-stack class="forma-component-tag">
<div class="forma-priority-stack" data-density="compact">
<section class="forma-surface" aria-labelledby="priority-stack-supporting-first-alerts">
<h2 id="priority-stack-supporting-first-alerts">Alerts</h2>
<p>2 shipments delayed by weather.</p>
</section>
<section class="forma-surface" data-priority="primary" aria-labelledby="priority-stack-supporting-first-queue">
<h2 id="priority-stack-supporting-first-queue">Dispatch queue</h2>
<p>18 orders ready to assign. Oldest waiting 42 minutes.</p>
</section>
<section class="forma-surface" aria-labelledby="priority-stack-supporting-first-drivers">
<h2 id="priority-stack-supporting-first-drivers">Drivers</h2>
<p>11 available, 4 on break.</p>
</section>
</div>
</forma-priority-stack>
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 review workspace at phone width. Every region is full width and they stack in source order; the primary attribute has no visible effect because there is no extra space to share.
--forma-priority-min becomes 100%, so each region takes its own full-width row.data-priority never moves a region to the top.<forma-priority-stack class="forma-component-tag">
<div class="forma-priority-stack">
<article class="forma-surface" data-priority="primary" aria-labelledby="priority-stack-mobile-stacked-priority-doc">
<h2 id="priority-stack-mobile-stacked-priority-doc">Vendor agreement</h2>
<p>Draft 3 is ready for legal review.</p>
</article>
<aside class="forma-surface" aria-labelledby="priority-stack-mobile-stacked-priority-notes">
<h2 id="priority-stack-mobile-stacked-priority-notes">Notes</h2>
<p>Finance approved the payment terms.</p>
</aside>
</div>
</forma-priority-stack>
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-priority | direct child | primary | absent | Marks the region that receives extra space (flex-grow 2). Not a data-forma-* hook; presentation only. |
data-density | .forma-priority-stack | 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-labelledby | regions | id of the region heading | — | Names each region by its heading. |
name | checkbox inputs | string | — | Form field names used in the review example. |
checked | checkbox inputs | boolean | absent | Initial checked state in the review example. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-priority-stack | Block class | — | Wrapping flex row. Each child has basis --forma-priority-min and a minimum of min(100%, --forma-priority-min). |
[data-density] | Attribute hook | — | Density posture. relaxed = 1.5rem, standard = 1rem, compact and analytical = 0.5rem gap; overrides --forma-priority-space. |
[data-priority] | Attribute hook | — | primary on a direct child sets flex-grow to 2, so it takes a larger share of extra space. |
--forma-priority-min | Custom property | — | Preferred and minimum width of each region. Default 18rem; 100% at 30rem viewport width and below. |
--forma-priority-space | Custom property | — | Gap between regions. Default --forma-primitive-spacing-4 (1rem). |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves through regions in source order, regardless of which is primary. |
Not a form control.
| State | How it is expressed | Presentation |
|---|---|---|
| Shared row | row fits all regions at --forma-priority-min | Primary region grows twice as fast as the others. |
| Wrapped | row too narrow for all regions | Regions wrap in source order; each line's regions share its width. |
| Stacked | viewport at or below 30rem | Every region is full width. |
| Density posture | data-density attribute | Gap follows the posture. |
data-priority instead.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.