VERIFICATION-0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
| Region | Q1 | Q2 | Q3 | Q4 | Year |
|---|---|---|---|---|---|
| North America | 1,204,000 | 1,318,500 | 1,402,250 | 1,511,000 | 5,435,750 |
| Europe | 904,100 | 931,000 | 1,010,400 | 1,120,900 | 3,966,400 |
<forma-bounded-overflow>
A contained scroll region for genuinely wide content so the page itself never scrolls horizontally.
<forma-bounded-overflow>patterns/bounded-overflow.htmlBounded overflow wraps content that cannot reflow, such as a wide table, a long log line or a timeline, in a region that scrolls on its own. The page keeps its width, so everything else still reflows at 320px and 400% zoom (WCAG 1.4.10 allows two-dimensional scrolling only for content that needs it). Scrolling is native: the browser supplies scrollbars, touch panning and keyboard scrolling once the region is focusable. Scroll chaining to the page is stopped at the edges, and the scrollbar gutter is reserved so content does not jump when a scrollbar appears.
overflow: auto scrolls in whichever direction the content exceeds the region.overscroll-behavior: contain stops a swipe at the region's edge from scrolling the page.scrollbar-gutter: stable reserves scrollbar space to prevent layout shift.The smallest correct markup: the canonical pattern from patterns/bounded-overflow.html inside its public tag. Copy this first, then adapt labels, names and state.
Rendered from the canonical pattern file.
| Region | Q1 | Q2 | Q3 | Q4 | Year |
|---|---|---|---|---|---|
| North America | 1,204,000 | 1,318,500 | 1,402,250 | 1,511,000 | 5,435,750 |
| Europe | 904,100 | 931,000 | 1,010,400 | 1,120,900 | 3,966,400 |
<forma-bounded-overflow class="forma-component-tag">
<div class="forma-bounded-overflow" role="region" aria-label="Quarterly totals by region" tabindex="0">
<table>
<thead><tr><th scope="col">Region</th><th scope="col">Q1</th><th scope="col">Q2</th><th scope="col">Q3</th><th scope="col">Q4</th><th scope="col">Year</th></tr></thead>
<tbody>
<tr><th scope="row">North America</th><td>1,204,000</td><td>1,318,500</td><td>1,402,250</td><td>1,511,000</td><td>5,435,750</td></tr>
<tr><th scope="row">Europe</th><td>904,100</td><td>931,000</td><td>1,010,400</td><td>1,120,900</td><td>3,966,400</td></tr>
</tbody>
</table>
</div>
</forma-bounded-overflow>
Click or tap the code once to select all of it, then copy.
A seven-column ledger in a focusable, named scroll region. On narrow screens the table scrolls horizontally inside the region while the page stays put; the caption and row headers keep the data understandable while scrolled.
| Invoice | Customer | Issued | Due | Amount | Paid | Status |
|---|---|---|---|---|---|---|
| INV-2291 | Northwind Logistics | 2026-09-01 | 2026-09-18 | $12,400.00 | $0.00 | Overdue |
| INV-2304 | Contoso Pharmacy | 2026-09-08 | 2026-10-08 | $3,150.00 | $1,000.00 | Partly paid |
| INV-2317 | Fabrikam Manufacturing | 2026-09-15 | 2026-10-15 | $48,900.00 | $0.00 | Sent |
<forma-bounded-overflow class="forma-component-tag">
<div class="forma-bounded-overflow" role="region" aria-labelledby="bounded-overflow-wide-ledger-caption" tabindex="0">
<table class="forma-dense-ledger">
<caption id="bounded-overflow-wide-ledger-caption">Open invoices, September 2026</caption>
<thead><tr><th scope="col">Invoice</th><th scope="col">Customer</th><th scope="col">Issued</th><th scope="col">Due</th><th scope="col">Amount</th><th scope="col">Paid</th><th scope="col">Status</th></tr></thead>
<tbody>
<tr><th scope="row">INV-2291</th><td>Northwind Logistics</td><td>2026-09-01</td><td>2026-09-18</td><td>$12,400.00</td><td>$0.00</td><td>Overdue</td></tr>
<tr><th scope="row">INV-2304</th><td>Contoso Pharmacy</td><td>2026-09-08</td><td>2026-10-08</td><td>$3,150.00</td><td>$1,000.00</td><td>Partly paid</td></tr>
<tr><th scope="row">INV-2317</th><td>Fabrikam Manufacturing</td><td>2026-09-15</td><td>2026-10-15</td><td>$48,900.00</td><td>$0.00</td><td>Sent</td></tr>
</tbody>
</table>
</div>
</forma-bounded-overflow>
Click or tap the code once to select all of it, then copy.
Unwrapped log lines in a region capped at 10rem tall with an inline max-block-size. The region scrolls in both directions; the dashboard around it keeps its height and width.
09:40:02 build payments-api@7.3.2 compiled in 84.1s (cache hit ratio 0.92)
09:40:15 push registry.example.com/payments/payments-api:7.3.2-4f2a91c pushed
09:40:31 deploy rolling update started: 0/12 pods ready, maxUnavailable=1, maxSurge=2
09:41:10 deploy 6/12 pods ready
09:41:52 deploy 12/12 pods ready
09:41:53 verify health check /healthz returned 200 on all pods
09:42:05 verify synthetic checkout test passed in 612ms
09:42:06 done deployment 7.3.2 completed
<forma-bounded-overflow class="forma-component-tag">
<section class="forma-surface forma-stack" data-density="compact" aria-labelledby="bounded-overflow-bounded-log-title">
<h2 id="bounded-overflow-bounded-log-title">Deployment 7.3.2 log</h2>
<div class="forma-bounded-overflow" style="max-block-size: 10rem" role="region" aria-label="Deployment 7.3.2 log output" tabindex="0">
<pre><code>09:40:02 build payments-api@7.3.2 compiled in 84.1s (cache hit ratio 0.92)
09:40:15 push registry.example.com/payments/payments-api:7.3.2-4f2a91c pushed
09:40:31 deploy rolling update started: 0/12 pods ready, maxUnavailable=1, maxSurge=2
09:41:10 deploy 6/12 pods ready
09:41:52 deploy 12/12 pods ready
09:41:53 verify health check /healthz returned 200 on all pods
09:42:05 verify synthetic checkout test passed in 612ms
09:42:06 done deployment 7.3.2 completed</code></pre>
</div>
</section>
</forma-bounded-overflow>
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.
A four-column schedule on a phone. The table is wider than the screen, so only the bounded region scrolls horizontally; headings and text around it still reflow.
max-inline-size: 100%, so it is never wider than the screen; the table scrolls inside it with a swipe.<forma-bounded-overflow class="forma-component-tag">
<div class="forma-bounded-overflow" role="region" aria-labelledby="bounded-overflow-mobile-table-scroll-caption" tabindex="0">
<table class="forma-dense-ledger">
<caption id="bounded-overflow-mobile-table-scroll-caption">On-call schedule, week 40</caption>
<thead><tr><th scope="col">Engineer</th><th scope="col">Primary shift</th><th scope="col">Secondary shift</th><th scope="col">Escalation contact</th></tr></thead>
<tbody>
<tr><th scope="row">Mateo Alvarez</th><td>Mon 09:00 – Wed 09:00 UTC</td><td>Thu 09:00 – Fri 18:00 UTC</td><td>Payments team lead</td></tr>
<tr><th scope="row">Priya Raman</th><td>Wed 09:00 – Fri 18:00 UTC</td><td>Mon 09:00 – Tue 18:00 UTC</td><td>Platform duty manager</td></tr>
</tbody>
</table>
</div>
</forma-bounded-overflow>
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 |
|---|---|---|---|---|
tabindex | .forma-bounded-overflow | 0 | — | Makes the scroll region focusable so keyboard users can scroll it. Required when the content has no focusable elements. |
role | .forma-bounded-overflow | region | — | Exposes the focusable scroll region as a named region, so focus lands on something with a role and name. |
aria-label | .forma-bounded-overflow | string | — | Names the region when there is no caption to reference. |
aria-labelledby | .forma-bounded-overflow | id of the table caption | — | Names the region from the table caption. |
style | .forma-bounded-overflow | max-block-size: <length> | — | Caps the height to make the region scroll vertically as well. |
scope | th | col | row | — | Associates header cells with their column or row so scrolled cells stay understandable. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-bounded-overflow | Block class | — | Scroll container: max-inline-size: 100%, overflow: auto, overscroll-behavior: contain, scrollbar-gutter: stable. Draws no border or background. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves focus to the region (when tabindex="0") and then into any focusable content. |
| Arrow keys | Scroll the focused region horizontally and vertically. Native browser behavior. |
| Page Up / Page Down, Home / End | Scroll the focused region by a page or to its start or end. Native browser behavior. |
| Event | Description |
|---|---|
scroll | Native scroll event on the region. Forma does not use it. |
Not a form control.
| State | How it is expressed | Presentation |
|---|---|---|
| Fits | content no larger than the region | No scrollbar; the gutter space is still reserved where the platform shows classic scrollbars. |
| Scrollable | content wider or taller than the region | Native scrollbars appear; the page does not scroll with the content. |
| Focused | :focus-visible | The shared Forma focus ring outlines the region. |
max-block-size when vertical containment is also needed, for example in dashboard panels.scroll-behavior: auto, so programmatic smooth scrolling is disabled for users who prefer reduced motion.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.