Featured story
Visual emphasis through span, without semantic reordering.
<forma-mosaic>
Asymmetric editorial composition using explicit spans and deterministic narrow-screen reflow.
<forma-mosaic>patterns/mosaic.htmlA mosaic is a four-column editorial grid in which the author gives some items more width with data-span="2" or data-span="full". It suits landing pages, report overviews and collections where one feature item leads and others support it. The rhythm is deliberate rather than content-driven: four columns on wide screens, two at 48rem and below, one at 30rem and below. Emphasis comes only from span; the source order is always the reading order. The application decides which items are featured.
minmax(0, 1fr) columns, so items never force overflow.data-span="2" takes half the row; data-span="full" takes the whole row.The smallest correct markup: the canonical pattern from patterns/mosaic.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
Visual emphasis through span, without semantic reordering.
Supporting item.
Supporting item.
Full-width region returns to one column on narrow screens.
<forma-mosaic class="forma-component-tag">
<section class="forma-mosaic" aria-label="Editorial collection">
<article class="forma-surface" data-span="2"><h2>Featured story</h2><p>Visual emphasis through span, without semantic reordering.</p></article>
<article class="forma-surface"><h2>Research</h2><p>Supporting item.</p></article>
<article class="forma-surface"><h2>Example</h2><p>Supporting item.</p></article>
<article class="forma-surface" data-span="full"><h2>Next step</h2><p>Full-width region returns to one column on narrow screens.</p></article>
</section>
</forma-mosaic>
Click or tap the code once to select all of it, then copy.
A featured summary takes two of four columns, two supporting items fill the row, and a full-width methodology note closes the section. Reading order is summary, revenue, retention, methodology.
Revenue grew 14% on the previous quarter, driven by the Team plan. Support response times improved for the third quarter running.
$2.1M, up 14%.
94% of accounts renewed.
Figures are unaudited and exclude one-off professional services revenue.
<forma-mosaic class="forma-component-tag">
<section class="forma-mosaic" aria-label="Q3 report overview">
<article class="forma-surface forma-stack" data-span="2" aria-labelledby="mosaic-quarterly-report-summary">
<h2 id="mosaic-quarterly-report-summary">Q3 in summary</h2>
<p>Revenue grew 14% on the previous quarter, driven by the Team plan. Support response times improved for the third quarter running.</p>
</article>
<article class="forma-surface" aria-labelledby="mosaic-quarterly-report-revenue">
<h2 id="mosaic-quarterly-report-revenue">Revenue</h2>
<p>$2.1M, up 14%.</p>
</article>
<article class="forma-surface" aria-labelledby="mosaic-quarterly-report-retention">
<h2 id="mosaic-quarterly-report-retention">Retention</h2>
<p>94% of accounts renewed.</p>
</article>
<article class="forma-surface" data-span="full" aria-labelledby="mosaic-quarterly-report-method">
<h2 id="mosaic-quarterly-report-method">Methodology</h2>
<p>Figures are unaudited and exclude one-off professional services revenue.</p>
</article>
</section>
</forma-mosaic>
Click or tap the code once to select all of it, then copy.
Two items each span two columns to form a balanced first row, followed by four single-column items. A tighter gap is set with --forma-mosaic-space.
Remote caching and smaller test shards.
Lessons from auditing every settings page.
Offline drafts.
Clearer incident timelines.
Two platform roles open.
Every second Thursday.
<forma-mosaic class="forma-component-tag">
<section class="forma-mosaic" style="--forma-mosaic-space: 0.75rem" aria-label="Engineering blog">
<article class="forma-surface" data-span="2"><h2>How we cut build times in half</h2><p>Remote caching and smaller test shards.</p></article>
<article class="forma-surface" data-span="2"><h2>Designing for 200% zoom</h2><p>Lessons from auditing every settings page.</p></article>
<article class="forma-surface"><h3>Release 5.1</h3><p>Offline drafts.</p></article>
<article class="forma-surface"><h3>Status page changes</h3><p>Clearer incident timelines.</p></article>
<article class="forma-surface"><h3>Hiring</h3><p>Two platform roles open.</p></article>
<article class="forma-surface"><h3>Office hours</h3><p>Every second Thursday.</p></article>
</section>
</forma-mosaic>
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 report overview at phone width. At 30rem and below the mosaic is one column and every span resets, so items stack in source order at full width.
data-span items are reset to grid-column: auto.data-span="2" then fills the whole row, the same as full.<forma-mosaic class="forma-component-tag">
<section class="forma-mosaic" aria-label="Report on the go">
<article class="forma-surface" data-span="2" aria-labelledby="mosaic-mobile-single-column-summary">
<h2 id="mosaic-mobile-single-column-summary">Q3 in summary</h2>
<p>Revenue up 14% on the previous quarter.</p>
</article>
<article class="forma-surface" aria-labelledby="mosaic-mobile-single-column-retention">
<h2 id="mosaic-mobile-single-column-retention">Retention</h2>
<p>94% renewed.</p>
</article>
<article class="forma-surface" data-span="full" aria-labelledby="mosaic-mobile-single-column-method">
<h2 id="mosaic-mobile-single-column-method">Methodology</h2>
<p>Unaudited figures.</p>
</article>
</section>
</forma-mosaic>
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-span | direct child of .forma-mosaic | 2 | full | absent (one column) | Visual width of an item. Not a data-forma-* hook; it is presentation only. |
aria-label | .forma-mosaic | string | — | Names the composed section. |
aria-labelledby | items | id of the item heading | — | Names each article by its heading. |
style | .forma-mosaic | --forma-mosaic-space: <length> | — | Per-instance gap override. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-mosaic | Block class | — | Four-column grid (two at 48rem and below, one at 30rem and below); children get min-inline-size: 0. |
--forma-mosaic-space | Custom property | default var(--forma-primitive-spacing-4, 1rem) | Gap between items. Default --forma-primitive-spacing-4 (1rem). |
[data-span] | Attribute hook | — | On a direct child: 2 spans two columns, full spans all columns. Reset to auto at one column. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves through items in source order; spans never change focus order. |
Not a form control.
| State | How it is expressed | Presentation |
|---|---|---|
| Four columns | viewport above 48rem | Full editorial rhythm with spans. |
| Two columns | viewport at or below 48rem | data-span="2" and full both fill the row. |
| One column | viewport at or below 30rem | Spans reset; items stack in source order. |
minmax(0, 1fr) and children min-inline-size: 0, preventing horizontal overflow.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.