Why we moved billing to event sourcing
Two years ago our invoices were computed from a mutable ledger. Every correction overwrote history, and every audit started with a reconstruction.
<forma-focus-stage>
Dominant primary work surface with subordinate supporting context that stacks without semantic reordering.
<forma-focus-stage>patterns/focus-stage.htmlA focus stage gives one piece of work all the available space and puts supporting context, such as an inspector, checklist or reference, in a bounded column beside it. The support column has a fixed range (14rem to 20rem by default), so the primary surface grows with the window while the support stays readable but never competes. On narrow screens the support stacks after the primary work in source order. Forma owns the proportions and the stacking; what the support column contains and when it changes is application content.
minmax(0, 1fr) and var(--forma-focus-stage-support), so the primary surface takes every extra pixel.min-inline-size: 0 and align to the top.The smallest correct markup: the canonical pattern from patterns/focus-stage.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.
Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.
<forma-focus-stage class="forma-component-tag">
<section class="forma-focus-stage" aria-label="Focused work">
<main class="forma-focus-stage__primary forma-surface"><h2>Primary artifact</h2><p>The dominant work surface receives available space.</p></main>
<aside class="forma-focus-stage__support forma-stack"><h2>Inspector</h2><label>Title <input value="Primary artifact"></label><button type="button">Apply</button></aside>
</section>
</forma-focus-stage>
Click or tap the code once to select all of it, then copy.
The article body is the dominant surface; a readiness checklist and the publish action sit in the support column. The support column is labelled so it can be reached as a landmark.
Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.
Two years ago our invoices were computed from a mutable ledger. Every correction overwrote history, and every audit started with a reconstruction.
<forma-focus-stage class="forma-component-tag">
<section class="forma-focus-stage" aria-label="Edit article">
<article class="forma-focus-stage__primary forma-surface" aria-labelledby="focus-stage-article-editor-title">
<h2 id="focus-stage-article-editor-title">Why we moved billing to event sourcing</h2>
<p>Two years ago our invoices were computed from a mutable ledger. Every correction overwrote history, and every audit started with a reconstruction.</p>
</article>
<aside class="forma-focus-stage__support forma-stack" aria-labelledby="focus-stage-article-editor-support">
<h3 id="focus-stage-article-editor-support">Before publishing</h3>
<ul>
<li>Summary written</li>
<li>Cover image missing</li>
<li>Reviewer: not assigned</li>
</ul>
<button type="button">Request review</button>
</aside>
</section>
</forma-focus-stage>
Click or tap the code once to select all of it, then copy.
The support track is narrowed with --forma-focus-stage-support and the gap tightened with --forma-focus-stage-space, for a dense review screen where the support holds only a few properties.
Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.
Photo shows a 2 m gap in the perimeter fence beside gate 3, with fresh tyre tracks on the inside.
<forma-focus-stage class="forma-component-tag">
<section class="forma-focus-stage" aria-label="Review site photo" style="--forma-focus-stage-support: minmax(10rem, 13rem); --forma-focus-stage-space: 0.75rem">
<article class="forma-focus-stage__primary forma-surface" aria-labelledby="focus-stage-narrow-support-title">
<h2 id="focus-stage-narrow-support-title">Site photo 14 · north fence line</h2>
<p>Photo shows a 2 m gap in the perimeter fence beside gate 3, with fresh tyre tracks on the inside.</p>
</article>
<aside class="forma-focus-stage__support forma-stack" aria-labelledby="focus-stage-narrow-support-props">
<h3 id="focus-stage-narrow-support-props">Photo details</h3>
<p>Taken 2 Oct, 10:14 by M. Chen.</p>
<button type="button">Flag for repair</button>
</aside>
</section>
</forma-focus-stage>
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.
At phone width the support column moves below the primary work, keeping the form first in both reading and focus order.
Static specimen. Submitting or resetting it needs the consuming application's form handling, which this documentation does not have. Its controls are shown for their markup and appearance and cannot be operated here.
minmax(0, 1fr) column; the 14rem support minimum no longer applies and nothing overflows at 320px.<forma-focus-stage class="forma-component-tag">
<section class="forma-focus-stage" aria-label="Expense claim">
<form class="forma-focus-stage__primary forma-stack" aria-labelledby="focus-stage-mobile-title">
<h2 id="focus-stage-mobile-title">New expense</h2>
<label for="focus-stage-mobile-amount">Amount</label>
<input id="focus-stage-mobile-amount" name="amount" inputmode="decimal">
<button type="submit">Submit claim</button>
</form>
<aside class="forma-focus-stage__support" aria-labelledby="focus-stage-mobile-support">
<h3 id="focus-stage-mobile-support">Policy</h3>
<p>Meals over $75 need an itemized receipt.</p>
</aside>
</section>
</forma-focus-stage>
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.
Static specimen. Its buttons stand for application actions that the consuming application implements; this script-free documentation does not perform them. Its controls are shown for their markup and appearance and cannot be operated here.
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 |
|---|---|---|---|---|
aria-label | root, support aside | string | — | Names the stage and the support landmark when they have no visible heading. |
aria-labelledby | primary and support regions | id of a visible heading | — | Names each region by its heading. |
style | root | --forma-focus-stage-support, --forma-focus-stage-space | — | Per-instance override of the support track and gap. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-focus-stage | Block class | — | Root two-column grid: flexible primary track and bounded support track. |
.forma-focus-stage__primary | Element class | — | The dominant work surface. Often combined with forma-surface. |
.forma-focus-stage__support | Element class | — | The subordinate context column. Often combined with forma-stack. |
--forma-focus-stage-space | Custom property | default var(--forma-primitive-spacing-5, 1.5rem) | Gap between primary and support. Default the 1.5rem spacing token. |
--forma-focus-stage-support | Custom property | default minmax(14rem, 20rem) | Support track size. Default minmax(14rem, 20rem). |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves through the primary region first, then the support region. No added keyboard behavior. |
Not a form control. Either region may be a form.
| State | How it is expressed | Presentation |
|---|---|---|
| Staged | viewport wider than 48rem | Primary surface fills available space; support column stays between its minimum and maximum. |
| Stacked | @media (max-width: 48rem) | One column, primary first. |
main for the primary region only when the stage is the page's main content and there is no other main.minmax(0, 1fr) var(--forma-focus-stage-support); extra width always goes to the primary surface.--forma-focus-stage-support there.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.