Overview
Current record summary and legal actions supplied by the application.
<forma-tabs>
Focused views with keyboard and deep-link integration hooks plus mobile overflow strategy.
<forma-tabs>patterns/tabs.htmlTabs switch between sibling views of one object, such as the Overview, History and Evidence of a record. Forma styles the ARIA tabs structure: a role="tablist" of button role="tab" elements and role="tabpanel" sections. The selected tab is drawn from aria-selected="true" with a surface change and an accent underline. Forma has no script, so the application (Limen) owns selection: updating aria-selected, showing the right panel with hidden, roving tabindex, arrow-key movement, manual or automatic activation, and deep-link sync with the URL.
data-forma-motion-weight="light".The smallest correct markup: the canonical pattern from patterns/tabs.html inside its public tag. Copy this first, then adapt labels, names and state.
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.
Current record summary and legal actions supplied by the application.
<forma-tabs class="forma-component-tag">
<section class="forma-tabs" data-forma-motion-weight="light">
<div class="forma-tabs__list" role="tablist" aria-label="Record sections">
<button type="button" role="tab" id="tab-overview" aria-selected="true" aria-controls="panel-overview">Overview</button>
<button type="button" role="tab" id="tab-history" aria-selected="false" aria-controls="panel-history">History</button>
<button type="button" role="tab" id="tab-evidence" aria-selected="false" aria-controls="panel-evidence">Evidence</button>
</div>
<section class="forma-tabs__panel" id="panel-overview" role="tabpanel" aria-labelledby="tab-overview">
<h3>Overview</h3>
<p>Current record summary and legal actions supplied by the application.</p>
</section>
</section>
</forma-tabs>
Click or tap the code once to select all of it, then copy.
History is selected. The application has applied roving tabindex (only the selected tab is in the tab order), hidden the other panels, and marked the visible panel with data-forma-motion-entry so it fades in when shown.
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.
Issued 3 June to Northwind Ltd. Due 3 July.
Sent 3 June, viewed 4 June, reminder sent 1 July.
No payments recorded.
<forma-tabs class="forma-component-tag">
<section class="forma-tabs" data-forma-motion-weight="light" aria-labelledby="tabs-history-heading">
<h2 id="tabs-history-heading">Invoice 1042</h2>
<div class="forma-tabs__list" role="tablist" aria-label="Invoice sections">
<button type="button" role="tab" id="tabs-history-tab-overview" aria-selected="false" aria-controls="tabs-history-panel-overview" tabindex="-1">Overview</button>
<button type="button" role="tab" id="tabs-history-tab-history" aria-selected="true" aria-controls="tabs-history-panel-history">History</button>
<button type="button" role="tab" id="tabs-history-tab-payments" aria-selected="false" aria-controls="tabs-history-panel-payments" tabindex="-1">Payments</button>
</div>
<section class="forma-tabs__panel" id="tabs-history-panel-overview" role="tabpanel" aria-labelledby="tabs-history-tab-overview" hidden>
<h3>Overview</h3>
<p>Issued 3 June to Northwind Ltd. Due 3 July.</p>
</section>
<section class="forma-tabs__panel" id="tabs-history-panel-history" role="tabpanel" aria-labelledby="tabs-history-tab-history" data-forma-motion-entry>
<h3>History</h3>
<p>Sent 3 June, viewed 4 June, reminder sent 1 July.</p>
</section>
<section class="forma-tabs__panel" id="tabs-history-panel-payments" role="tabpanel" aria-labelledby="tabs-history-tab-payments" hidden>
<h3>Payments</h3>
<p>No payments recorded.</p>
</section>
</section>
</forma-tabs>
Click or tap the code once to select all of it, then copy.
Seven tabs in a narrow container. The list scrolls horizontally inside its own bounds with a thin scrollbar rather than wrapping; the page itself does not scroll sideways.
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.
Checkout service, tier 1, healthy.
Last deployed 2 hours ago.
No open alerts.
Depends on payments and inventory.
Owned by the Commerce team.
Within budget this month.
14 changes this week.
<forma-tabs class="forma-component-tag">
<section class="forma-tabs" style="max-inline-size: 24rem;">
<div class="forma-tabs__list" role="tablist" aria-label="Service details">
<button type="button" role="tab" id="tabs-overflow-tab-summary" aria-selected="true" aria-controls="tabs-overflow-panel-summary">Summary</button>
<button type="button" role="tab" id="tabs-overflow-tab-deployments" aria-selected="false" aria-controls="tabs-overflow-panel-deployments" tabindex="-1">Deployments</button>
<button type="button" role="tab" id="tabs-overflow-tab-alerts" aria-selected="false" aria-controls="tabs-overflow-panel-alerts" tabindex="-1">Alerts</button>
<button type="button" role="tab" id="tabs-overflow-tab-dependencies" aria-selected="false" aria-controls="tabs-overflow-panel-dependencies" tabindex="-1">Dependencies</button>
<button type="button" role="tab" id="tabs-overflow-tab-owners" aria-selected="false" aria-controls="tabs-overflow-panel-owners" tabindex="-1">Owners</button>
<button type="button" role="tab" id="tabs-overflow-tab-costs" aria-selected="false" aria-controls="tabs-overflow-panel-costs" tabindex="-1">Costs</button>
<button type="button" role="tab" id="tabs-overflow-tab-audit" aria-selected="false" aria-controls="tabs-overflow-panel-audit" tabindex="-1">Audit log</button>
</div>
<section class="forma-tabs__panel" id="tabs-overflow-panel-summary" role="tabpanel" aria-labelledby="tabs-overflow-tab-summary"><p>Checkout service, tier 1, healthy.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-deployments" role="tabpanel" aria-labelledby="tabs-overflow-tab-deployments" hidden><p>Last deployed 2 hours ago.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-alerts" role="tabpanel" aria-labelledby="tabs-overflow-tab-alerts" hidden><p>No open alerts.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-dependencies" role="tabpanel" aria-labelledby="tabs-overflow-tab-dependencies" hidden><p>Depends on payments and inventory.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-owners" role="tabpanel" aria-labelledby="tabs-overflow-tab-owners" hidden><p>Owned by the Commerce team.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-costs" role="tabpanel" aria-labelledby="tabs-overflow-tab-costs" hidden><p>Within budget this month.</p></section>
<section class="forma-tabs__panel" id="tabs-overflow-panel-audit" role="tabpanel" aria-labelledby="tabs-overflow-tab-audit" hidden><p>14 changes this week.</p></section>
</section>
</forma-tabs>
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.
Four tabs at phone width. The list becomes horizontally scrollable when the labels no longer fit; each tab keeps its full label and 44px height.
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-tabs__list scrolls horizontally inside its own bounds when they overflow.flex: 0 0 auto), so labels are never truncated or squeezed.<forma-tabs class="forma-component-tag">
<section class="forma-tabs">
<div class="forma-tabs__list" role="tablist" aria-label="Order sections">
<button type="button" role="tab" id="tabs-mobile-tab-items" aria-selected="true" aria-controls="tabs-mobile-panel-items">Items</button>
<button type="button" role="tab" id="tabs-mobile-tab-shipping" aria-selected="false" aria-controls="tabs-mobile-panel-shipping" tabindex="-1">Shipping</button>
<button type="button" role="tab" id="tabs-mobile-tab-returns" aria-selected="false" aria-controls="tabs-mobile-panel-returns" tabindex="-1">Returns</button>
<button type="button" role="tab" id="tabs-mobile-tab-messages" aria-selected="false" aria-controls="tabs-mobile-panel-messages" tabindex="-1">Customer messages</button>
</div>
<section class="forma-tabs__panel" id="tabs-mobile-panel-items" role="tabpanel" aria-labelledby="tabs-mobile-tab-items"><p>3 items, total 84.00.</p></section>
<section class="forma-tabs__panel" id="tabs-mobile-panel-shipping" role="tabpanel" aria-labelledby="tabs-mobile-tab-shipping" hidden><p>Ships from the Leeds warehouse.</p></section>
<section class="forma-tabs__panel" id="tabs-mobile-panel-returns" role="tabpanel" aria-labelledby="tabs-mobile-tab-returns" hidden><p>No returns requested.</p></section>
<section class="forma-tabs__panel" id="tabs-mobile-panel-messages" role="tabpanel" aria-labelledby="tabs-mobile-tab-messages" hidden><p>No messages.</p></section>
</section>
</forma-tabs>
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 |
|---|---|---|---|---|
role | list, buttons, panels | tablist | tab | tabpanel | — | Required ARIA tabs roles. Forma's selectors target [role="tab"] inside the list. |
aria-selected | tab | true | false | — | Set by the application. Forma draws the selected treatment from aria-selected="true". |
aria-controls | tab | id of its panel | — | Links each tab to its panel. Every referenced panel must exist in the DOM. |
aria-labelledby | tabpanel | id of its tab | — | Names the panel after its tab. |
aria-label | tablist | string | — | Names the set of tabs. |
tabindex | tab | -1 on unselected tabs | 0 (native button) | Roving tab stop written by the application so Tab enters the list once, at the selected tab. |
hidden | tabpanel | boolean | absent | Hides inactive panels. The application toggles it with selection. |
type | tab | button | — | Prevents tabs inside a form from submitting it. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-tabs | Block class | — | Root section and motion scope. |
.forma-tabs__list | Element class | — | The tablist: a flex row with a bottom rule that scrolls horizontally when tabs overflow. |
.forma-tabs__panel | Element class | — | A tab panel with vertical padding. |
[data-forma-motion-entry] | Attribute hook | — | Presence attribute on .forma-tabs__panel. When the panel is inserted or un-hidden it starts at zero opacity and 0.25rem lower, then settles into place. |
[data-forma-motion-weight] | Attribute hook | "heavy", "light", "standard" | Presentation-only perceived mass for the underline and tab settle: light (default here), standard or heavy. Never encodes importance. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Native: moves focus to and from the tab list. With application roving tabindex, only the selected tab is a stop; then Tab moves into the panel. |
| Enter / Space | Native button activation. The application selects the focused tab in response. |
| Left / Right Arrow, Home, End | Not native. The application must move focus between tabs and, for automatic activation, select on focus. |
| Event | Description |
|---|---|
click | Native click on a tab button; the application updates aria-selected, tabindex, hidden and the URL. |
Does not participate in forms. Tabs are buttons with type="button" so they never submit.
| State | How it is expressed | Presentation |
|---|---|---|
| Unselected | aria-selected="false" | Transparent tab, nudged 0.08rem down, underline scaled to zero. |
| Selected | aria-selected="true" | Secondary surface, settled position and a 3px accent underline. |
| Focus | :focus-visible | Foundation two-tone focus ring on the tab. |
| Panel shown | hidden removed, optional data-forma-motion-entry | Panel visible; with the entry hook it fades and rises into place. |
| Overflowing | tabs wider than the list | The list scrolls horizontally inside itself. |
overflow-x: auto, thin scrollbar) instead of wrapping.data-forma-motion-entry fades in and rises 0.25rem when it appears.prefers-reduced-motion: reduce these transitions are effectively instant.Forma motion is physics-derived: perceived mass changes how a surface accelerates and settles, never what state it is in. Compare the three presentation weights of the same markup:
Current record summary and legal actions supplied by the application.
Current record summary and legal actions supplied by the application.
Current record summary and legal actions supplied by the application.
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.