Scope trail
<forma-scope-trail>
Keeps parent and current scope explicit as users move through nested or scaled representations.
- Authoring tag
<forma-scope-trail>- Category
- Navigation
- Behavior owner
- Application content
- Canonical source
patterns/scope-trail.html
Purpose
A scope trail states where the user is: each ancestor scope as a link and the current scope as plain text marked aria-current="page". It is a labelled nav with an ordered list; Forma lays the items out as a wrapping row with a slash drawn between them. It is used for ordinary nested records (System / Billing / Invoice 1042) and for scaled or zoomed representations, where the trail keeps the parent scope explicit while the view changes. The application supplies the ancestors and URLs.
Use when
- Users drill into nested objects and need a way back to each parent.
- A zoomable or scaled view (map, diagram, canvas) needs the current scope stated in text.
- The current location must be available to assistive technology, not only implied by the view.
Avoid when
- Navigating between sibling pages of a result set: use Pagination.
- Showing a whole hierarchy to browse: use Hierarchy tree.
- Showing progress through a process: use Wizard or Steps.
- Recording where a value came from: use Provenance trail.
Behavior to know
- Ordered list semantics communicate depth; the slash separator is generated by CSS.
- The current scope is text, not a link, so it cannot be activated to reload itself.
- Items wrap onto several lines instead of truncating or scrolling.
- No visual styling beyond layout; links use the theme's link treatment.
Basic example
The smallest correct markup: the canonical pattern from patterns/scope-trail.html inside its public tag. Copy this first, then adapt labels, names and state.
Minimal scope trail
Rendered from the canonical pattern file.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
<forma-scope-trail class="forma-component-tag">
<nav class="forma-scope-trail" aria-label="Current scope"><ol><li><a href="#system">System</a></li><li><a href="#billing">Billing</a></li><li aria-current="page">Invoice 1042</li></ol></nav>
</forma-scope-trail>
Click or tap the code once to select all of it, then copy.
Examples
Deeply nested record with long names
Five levels with long names. The row wraps between items; every ancestor stays a real link and the current scope is plain text.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
<forma-scope-trail class="forma-component-tag">
<nav class="forma-scope-trail" aria-label="Current scope">
<ol>
<li><a href="#scope-deep-org">Northwind Holdings</a></li>
<li><a href="#scope-deep-region">Europe, Middle East and Africa</a></li>
<li><a href="#scope-deep-account">Northwind Logistics GmbH</a></li>
<li><a href="#scope-deep-contract">Master services agreement 2026</a></li>
<li aria-current="page">Amendment 3: data processing terms</li>
</ol>
</nav>
</forma-scope-trail>
Click or tap the code once to select all of it, then copy.
Scope of a zoomed diagram
In a zoomable architecture diagram the trail states the current zoom scope in text, followed by a heading for the current representation. Selecting an ancestor zooms back out.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
Payment gateway components
Showing 6 components inside Payment gateway. Zoom out to see how Checkout connects to Inventory.
<forma-scope-trail class="forma-component-tag">
<nav class="forma-scope-trail" aria-label="Diagram scope">
<ol>
<li><a href="#scope-zoom-system">All systems</a></li>
<li><a href="#scope-zoom-checkout">Checkout</a></li>
<li aria-current="page">Payment gateway components</li>
</ol>
</nav>
<h2>Payment gateway components</h2>
<p>Showing 6 components inside Payment gateway. Zoom out to see how Checkout connects to Inventory.</p>
</forma-scope-trail>
Click or tap the code once to select all of it, then copy.
Mobile
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.
Scope trail on a phone
Four levels at phone width. Items wrap onto a second line; the separator stays at the start of each continued item.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
What changes at narrow widths
- The list is a wrapping flex row, so items continue on new lines instead of truncating or scrolling.
- Each separator belongs to the item after it, so a wrapped line starts with a slash, keeping the hierarchy readable.
- Long names wrap at spaces within their item, and link text can also break inside very long words.
- Links keep their inline text size; on touch-heavy pages give them extra padding in application styling, since Forma does not enforce 44px targets here.
<forma-scope-trail class="forma-component-tag">
<nav class="forma-scope-trail" aria-label="Folder scope">
<ol>
<li><a href="#scope-mobile-drive">Shared drive</a></li>
<li><a href="#scope-mobile-finance">Finance</a></li>
<li><a href="#scope-mobile-2026">2026 year-end close</a></li>
<li aria-current="page">Reconciliations</li>
</ol>
</nav>
</forma-scope-trail>
Click or tap the code once to select all of it, then copy.
Mobile · 320px
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
API and configuration
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 | nav | string | — | Names the landmark, for example Current scope. Use a distinct label if a page has several trails. |
aria-current | last li | page | absent | Marks the current scope. Put it on the plain-text item, not on a link to the same page. |
href | ancestor links | URL | — | Real URLs for each ancestor scope, supplied by the application. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-scope-trail | Block class | — | Root nav. Its ordered list becomes a wrapping flex row with small gaps and a CSS-generated slash before every item after the first. |
| Keys | Result |
|---|---|
| Tab / Shift+Tab | Moves through the ancestor links; the current scope is text and is not focusable. |
| Enter | Follows the focused link (native). |
Form behavior
Does not participate in forms.
States
| State | How it is expressed | Presentation |
|---|---|---|
| Ancestor | li containing a link | Rendered with the theme's link style. |
| Current | aria-current="page" on plain text | Unlinked text. Forma adds no extra highlight; the absence of a link distinguishes it. |
| Wrapped | narrow container | Items continue on the next line. |
Accessibility
Forma provides
- Keeps list semantics so the number of levels and position are available to assistive technology.
- Draws separators with CSS rather than text in the markup.
Your application supplies
- Provide the full ancestor chain with meaningful, unique names.
- Keep the current scope in text and mark it with aria-current.
- Update the trail and the page heading together when the scope changes, and move focus to the heading after a scope change in a single-page application.
Responsive behavior
- A wrapping flex row with 0.25rem row and 0.5rem column gaps.
- No truncation or collapsing; very deep trails simply take more lines.
- No breakpoints.
Motion
- No animation: the trail is static text and links.
Usage guidance
Do
- Use the same names in the trail as in the headings users arrive at.
- Place the trail directly above the heading of the current scope.
Avoid
- Linking the current scope to itself.
- Using the trail as the only indication of scope in a zoomed view; also state it in the heading.
Verification specimens
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.