Contact Us

Menu Configuration

DOC-00003 reference implementor, developer

The menu configuration contract defines the main navigation and utility navigation (footer) structures. The contract lives in two files across the core/ and site/ directories:

  • src/core/config/menu.schema.ts (CORE-OWNED) — TypeScript types, interfaces, and DEFAULT_MENU_CONFIG
  • src/site/config/menu.ts (SITE-OWNED) — the site-specific instance that overrides defaults

Social links are not part of menu config — they live in Site Configuration at the top level for cross-context reuse.

For the complete field inventory with types and defaults, see src/core/config/menu.schema.ts. This reference documents the system structure, customization pattern, and key design decisions.

Who this is for

  • Implementors building header, footer, and mobile navigation components
  • Developers customizing navigation for a specific site
  • AI agents generating or modifying menu config values

Customization Pattern

The menu instance uses the same spread-override pattern as site config:

// src/site/config/menu.ts (SITE-OWNED)
import { DEFAULT_MENU_CONFIG, type MenuConfig } from "@core/config/menu.schema";

export const menuConfig: MenuConfig = {
  ...DEFAULT_MENU_CONFIG,
  mainNav: [
    { label: "Home", href: "/" },
    { label: "Services", href: "/services/" },
    { label: "Blog", href: "/blog/" },
    { label: "Contact", href: "/contact/" },
  ],
};

mainNav: MainNavConfig — an ordered array of NavItem objects. Each item has a label, an optional href, and optional children for dropdowns.

Max nesting depth: The type system enforces a max depth of one nested level. children items have label and href only — no further children property. This keeps navigation accessible and keyboard-friendly.

The default config includes placeholder items that exercise all nav patterns — flat links, a dropdown with children, and an external link:

const mainNav = [
  { label: "Home", href: "/" },
  { label: "About", href: "/about/" },
  {
    label: "Dropdown",
    children: [
      { label: "Terms of Use", href: "/terms/" },
      { label: "Privacy Policy", href: "/privacy/" },
    ],
  },
  { label: "Google", href: "https://www.google.com" },
];

Utility Navigation

footerNav: FooterNavConfig — grouped link lists rendered in the footer. Groups include footerNav1, footerNav2, footerNav3, and an optional footerNavLinks array. Each group is an array of { label, href } objects.

Social links are sourced from the top-level socialLinks in site config — they are not duplicated in utility nav.

const footerNav = {
  footerNav1: [
    { label: "Google", href: "https://www.google.com" },
    { label: "Github", href: "https://www.github.com" },
  ],
  footerNav2: [
    { label: "About", href: "/about/" },
    { label: "Contact", href: "/contact/" },
  ],
  footerNav3: [
    { label: "Terms of Use", href: "/terms/" },
    { label: "Privacy Policy", href: "/privacy/" },
  ],
};
REQ-00147 implemented Navigation implementation shall separate menu data contract, resolver logic, and render/layout integration responsibilities.
REQ-00150 implemented Menu customization APIs shall preserve structural and behavior-critical classes/attributes, limiting overrides to documented slots or token-driven surfaces.
REQ-00178 implemented Mobile navigation shall inherit menu items from the Primary Menu by default and shall support override via a dedicated mobile menu configuration when a distinct item set is required.

Search

Search across pages and articles. Use arrow keys to navigate results.

Search across pages and articles.

Loading search...

Search is unavailable. Please try again later.

    No results for ""

    Try different keywords or fewer words.