mica
mica

Example

Quiet ancestor links and a plain current-page label. Long trails wrap naturally; separators stay attached to the following crumb.

Open the full example for narrow-width, dark-theme, and RTL controls.

Usage

<nav data-breadcrumbs aria-label="Breadcrumb">
  <ol role="list">
    <li><a href="/projects">Projects</a></li>
    <li><span aria-current="page">Website refresh</span></li>
  </ol>
</nav>

Use a native navigation landmark, ordered list, and real links. The current page can be a span or an a with aria-current="page". The explicit list role preserves list semantics when list markers are removed in Safari. Separators are decorative CSS borders with no spoken text.

No JavaScript is needed for the full trail. Mica does not generate hierarchy, infer routes, truncate labels, or hide ancestors automatically.

Collapsed ancestors

For a deep hierarchy, author the earlier ancestors inside a disclosure at the beginning of the list. Keep the immediate parent and current page visible. The native disclosure still opens and closes without JavaScript.

<script type="module" src="breadcrumbs.js"></script>
<nav data-breadcrumbs aria-label="Breadcrumb">
  <ol role="list">
    <li>
      <m-breadcrumb-overflow>
        <details>
          <summary aria-label="Show ancestor pages"></summary>
          <ol data-breadcrumb-menu role="list">
            <li><a href="/">Workspace</a></li>
            <li><a href="/team">Design team</a></li>
          </ol>
        </details>
      </m-breadcrumb-overflow>
    </li>
    <li><a href="/projects">Projects</a></li>
    <li><span aria-current="page">Website refresh</span></li>
  </ol>
</nav>

The optional module enhances each m-breadcrumb-overflow instance. It positions the panel within the viewport and flips above when needed, adds Escape with summary focus restoration, and closes on outside click, focus leaving, or an unprevented link activation. Modified link clicks retain browser behavior.

Tab and Shift+Tab use native focus order. These are navigation links, not an ARIA menu widget. The module generates no content and does not change routes.

Without the module, the panel opens beneath its summary using CSS positioning. It does not automatically clamp to viewport edges or dismiss on Escape/outside click. Place the disclosure first and avoid clipping ancestors. Enhanced panels use fixed positioning, not the top layer; transformed ancestors can change their containing block.

API

PartContractDescription
data-breadcrumbsNative nav with a direct olDirect list items contain ancestor links or the current-page label.
m-breadcrumb-overflowOptional child of a list itemOne direct details, with summary first and the ancestor list after it.
data-breadcrumb-menuDirect ol inside the disclosureNative list items and links. Supply a descriptive summary label.
TokenDefaultDescription
--breadcrumb-font-size.8125remTrail and ancestor link size.
--breadcrumb-gap--space-xsHorizontal spacing.
--breadcrumb-row-gap--space-2xsSpace between wrapped rows.
--breadcrumb-current-weight500Current-page and disclosure-trigger emphasis.
--breadcrumb-separator-size.3remDecorative chevron size.
--breadcrumb-separator-color--color-text-mutedDecorative chevron color.
--breadcrumb-menu-width14remPreferred ancestor panel width, capped to the viewport.
--breadcrumb-overflow-font-size1remAncestor disclosure trigger text size.
--breadcrumb-menu-target2.25remDisclosure width and minimum height; ancestor link minimum height.
--breadcrumb-menu-z5Enhanced and native panel stacking level.

Shared color and radius tokens apply throughout. Internal data-m-* state and --m-* placement values belong to the enhancement.

← navigation menupagination →