Navigation

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

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.

Canonical

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.

HTML · Minimal scope trail Raw HTML for HTML · Minimal scope trail
<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

Scenario

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.

HTML · Deeply nested record with long names Raw HTML for HTML · Deeply nested record with long names
<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.

Scenario

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.

HTML · Scope of a zoomed diagram Raw HTML for HTML · Scope of a zoomed diagram
<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.

Mobile example

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.

Viewport width

Frames narrower than the selected width show the component at the width available.

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.
HTML · Scope trail on a phone Raw HTML for HTML · Scope trail on a phone
<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.

Baseline

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.

Viewport width

Frames narrower than the selected width show the component at the width available.

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.

Native and ARIA attributes
AttributeOnValuesDefaultDescription
aria-labelnavstring—Names the landmark, for example Current scope. Use a distinct label if a page has several trails.
aria-currentlast lipageabsentMarks the current scope. Put it on the plain-text item, not on a link to the same page.
hrefancestor linksURL—Real URLs for each ancestor scope, supplied by the application.
CSS hooks (derived from dist/all.css)
HookKindValues or defaultDescription
.forma-scope-trailBlock 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.
Keyboard interaction
KeysResult
Tab / Shift+TabMoves through the ancestor links; the current scope is text and is not focusable.
EnterFollows the focused link (native).

Form behavior

Does not participate in forms.

States

Scope trail states
StateHow it is expressedPresentation
Ancestorli containing a linkRendered with the theme's link style.
Currentaria-current="page" on plain textUnlinked text. Forma adds no extra highlight; the absence of a link distinguishes it.
Wrappednarrow containerItems 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.