B
Bonzai 2
Extensions

Mega Menu

3-level hierarchical navigation with desktop mega menu panels and mobile drawer.

ExtensionApplication Customizer

This is an Application Customizer, not a web part

Mega Menu is an SPFx Application Customizer that runs site-wide in the header placeholder. You don't add it to individual pages — once activated, it appears on every page in your site collection.

Two-step activation required

After uploading the Bonzai 2 package to your App Catalog, you must also add the Bonzai app to each site where you want to use Mega Menu. Go to Site Contents → New → App → Bonzai 2.

License banner awareness

Mega Menu is the host for Bonzai license validation. It runs whitelist/cache/API checks on page load and, if the tenant is in warning, expired, or unknown state, shows a banner at the top of the navigation bar. Navigation itself still renders, but Bonzai web parts may be gated. Contact support if the banner persists after activation.

Legacy package note

If your tenant previously deployed the separate bonzai-mega-menu package, remove that app from Site Contents after upgrading to the consolidated Bonzai 2 package to avoid duplicate initialization.

Admin-Blocked Apps Workaround

If “Apps you can add” is empty due to tenant policy, you can still activate Mega Menu by registering the Application Customizer in the Tenant Wide Extensions list.

  1. Open the App Catalog site: https://<tenant>.sharepoint.com/sites/appcatalog
  2. Go to Site ContentsTenant Wide Extensions
  3. Click NewApplication Customizer
  4. Fill in the fields below and click Save
Title: Bonzai Mega Menu
Component Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Location: ClientSideExtension.ApplicationCustomizer
Component Properties:
{"navigationListName":"MegaMenuNavigation","hideNativeNavigation":true,"hideMobileAppBar":true,"showBreadcrumb":true}
Sequence: 100 (optional)
Web Template / List Template / Host Properties: leave blank

Match the feature element defaults

These are the same defaults used by the solution's feature registration (sharepoint/assets/elements.xml). The optional licenseApiUrl and enableLicenseDebug properties can be added here as well; see the Extension Properties table below. If you change a property here, it only affects the tenant-wide registration; individual sites that already added the Bonzai app keep their existing per-site CustomAction properties.

Get Mega Menu Working in 4 Steps

45-60 minutes

Prerequisites

  • Bonzai 2 package (.sppkg) uploaded to your tenant App Catalog
  • Site Collection Administrator permissions on your target site
  • Understanding of SharePoint list creation
1

Create the Navigation list

Create a SharePoint list named "MegaMenuNavigation" with the required columns (see schema below).

2

Add your navigation items

Create list items for your menu hierarchy: Level 1 items have no parent, Level 2/3 items reference their parent.

3

Add the Bonzai app to your site

Go to Site Contents → New → App, then add the Bonzai 2 app to activate the Mega Menu extension on this site.

4

Verify and customize

Navigate your site to confirm the menu appears. Use the toggle button to show/hide native SharePoint navigation.

3-Level Navigation Hierarchy

Build rich navigation structures with up to 3 levels of nesting. Root items appear in the top bar, second level items appear in mega menu panels, and third level items appear as sub-links within those panels.

When to Use This Web Part

Use this when you need to...

  • Replace SharePoint's default horizontal navigation
  • Create a consistent mega menu across all site pages
  • Provide mobile-friendly slide-out navigation
  • Organize deep navigation hierarchies (up to 3 levels)
  • Centrally manage navigation from a SharePoint list

Best page locations

  • Intranet home sites — primary site navigation
  • Hub sites — unified navigation across connected sites
  • Multi-site deployments — share one navigation list across subsites
  • Communication sites — polished navigation experience
  • Any site needing multi-level navigation

Consider alternatives when...

  • Individual page navigation — use Advanced Links web part
  • Footer links — Mega Menu only appears in the header
  • Sites with simple single-level navigation — may be overkill

Related web parts:

Advanced Linkslink tiles on a specific pageSharePoint Hub Navigationnative hub site navigation

Branding and Logo

  • Mega Menu reserves a logo slot on the left for desktop and mobile layouts.
  • The logo slot always links to the current site collection root (pageContext.site.absoluteUrl), even on subsites.
  • Theme Manager → Mega Menu Branding exposes four dedicated color pickers:Background, Foreground, Hover Background, and Hover Foreground. Hover colors are independently configurable (not derived from the foreground color).
  • Provide an absolute PNG logo URL in Theme Manager to display the logo.
  • Spacing and breadcrumb controls (Theme Manager)
    • Navigation Bar Spacing: slider that adjusts padding on top-level nav items (50–150%, default 100%).
    • Dropdown Panel Spacing: separate slider for padding inside dropdown flyouts (50–150%, default 100%).
    • Breadcrumb controls: show/hide, left/center/right alignment, and an inset slider (0–40%) to push the breadcrumb inward responsively.
  • Mega Menu search bar (Theme Manager)
    • Show Search Bar: toggle to enable a typeahead search box in the navigation bar.
    • Search Scope: dropdown to limit search to "Entire Tenant", "Current Site Only", or a "Specific Site" (selected from a picker).
    • Four filter tabs: results are split into All, Documents, People, and Locations tabs, each with a count badge next to the tab name.
    • Minimum query length: typeahead activates at 2+ characters; shorter queries show no dropdown. Input is debounced by 300 ms.
    • Hit highlighting: matching substrings in titles, descriptions, names, and emails are wrapped in <strong> tags for emphasis.
    • "Show all" footer link: pressing Enter (with no result focused) or clicking the footer navigates to /_layouts/15/search.aspx?q=<query> for the full results page.
    • Search results show friendly content type labels (e.g., "Word", "PDF", "Page", "Excel", "PowerPoint", "News", "Event", "Spotlight") instead of raw SharePoint content type names.
    • People search uses a multi-source fallback strategy: tries two SharePoint Search people result sources plus the default source, then falls back to Microsoft Graph /users if none return results. Graph results link to Delve profiles.
    • Keyboard navigation through search results with visible focus indicator (Arrow Up/Down to move, Enter to open, Escape to close).
    • Content exclusions: system files, images, CSS/JS, master pages, page layouts, web part pages, _catalogs, Style Library, Form Templates, SitePages/Templates, and infrastructure list types (STS_List_*, STS_Site, STS_Web) are automatically filtered from content results.
    • Snippet sanitization: result descriptions are cleaned of SharePoint internal metadata, field labels, STS_* tokens, and duplicate title text.
    • Clear button: an X button appears inside the search input to clear the query and refocus the input.
    • Loading spinner: replaces the search icon while the API call is in progress.
    • 8-second timeout: prevents hung searches from blocking the UI (results fall back silently to empty).
    • Configurable placeholder text: set custom search placeholder text in Theme Manager (max 50 characters).
    • Configurable quick results count: control how many results appear in the dropdown (3–10, default 5) via Theme Manager.
    • Accessibility: ARIA role="search"/listbox/option, aria-live screen-reader announcements of result counts, aria-activedescendant focus tracking, and a focus trap on the mobile overlay.
    • Result caching: search results are cached in-memory for 60 seconds (per query/scope/rowLimit) to speed up repeated and tab-switching queries.
    • Content-aware icons: results show file-type icons (Word, Excel, PDF, PowerPoint, OneNote, Mail, HTML, Image, etc.) or content-type icons (News, Event/Calendar, Spotlight/FavoriteStar). Items without a recognized type show an initial avatar.
    • Graph badge: people results sourced from Microsoft Graph display a "via directory" badge.
    • Draft exclusion: unpublished/draft pages are automatically filtered via -PromotedState:0.
    • Mobile search overlay: on mobile, tapping the search icon opens a full-width overlay positioned directly below the mega menu, with a Close button and Tab focus trap.

    Page Layout Fix (Theme Manager)

    Some SharePoint sites (especially CMSPUBLISHING subsites) display a persistent left sidebar or have left-aligned content when full-width sections are used. The Mega Menu includes a built-in page layout fix controlled by three toggles in Theme Manager:

    • Enable Page Layout Fix: master toggle (off by default — zero impact until enabled)
    • Hide Left Sidebar: hides the native SharePoint left navigation panel across all site template variations (standard Modern, CMSPUBLISHING subsites, and classic left nav)
    • Center Page Content: re-centers page content that full-width zones push to the left

    Replaces the standalone center-fix package

    This feature replaces the separate bonzai-center-fix SPFx package and per-site PowerShell scripts that were previously required. No extra package or PowerShell deployment is needed — just enable the toggle in Theme Manager.

Breadcrumb is controlled in two places

The extension property showBreadcrumb enables the breadcrumb feature. Theme Manager then controls the breadcrumb's visibility and layout (show/hide, alignment, inset) using CSS custom properties.

Breadcrumb Behavior

When enabled, the breadcrumb renders just below the mega menu bar and reflects the current navigation context. It is built entirely from the SharePoint context — it does not read from the MegaMenuNavigation list.

  • Site-collection ancestry: if the current page is on a subsite, the breadcrumb prepends the site-collection title and every intermediate subsite (each fetched via /_api/web?$select=Titleand cached per URL).
  • Within-site path: after the ancestors, URL segments under the current web become breadcrumb links. System folders like SitePages, Pages, Forms, and _layouts are stripped; date prefixes (e.g., 2026-01-) are removed; and hyphens/underscores become spaces with title-casing.
  • Current page label: uses pageContext.listItem.title when available, otherwise falls back to a slug-to-title conversion of the last URL segment.
  • Home/welcome detection: on the site root, the configured welcome page, or common home paths (SitePages/Home.aspx, Pages/default.aspx, etc.), the breadcrumb renders only the site title (and collapses entirely when no ancestors exist).
  • SPA navigation aware: listens for popstate and polls the URL every 500 ms so it updates on SharePoint's client-side transitions without a full reload.

Navigation Hierarchy

Mega Menu supports a 3-level navigation structure:

1
Level 1: Top Bar Items

Root navigation items displayed in the horizontal menu bar. Click or hover to open Level 2 panel.

2
Level 2: Mega Menu Panel Items

Second-level items displayed in the dropdown mega menu panel. Can have Level 3 children.

3
Level 3: Sub-links within panels

Third-level items displayed as links under their Level 2 parent. Maximum nesting depth.

Desktop and Mobile Behavior

Desktop (≥ 769 px)

Horizontal bar + hover panels

  • Logo slot (left) linking to site collection root
  • Level 1 items in horizontal menubar
  • Hover opens Level 2/3 panel (50 ms delay)
  • Panel stays open 400 ms after mouse leaves for forgiving tracking
  • Click a Level 1 with children to toggle the panel open/closed
  • Keyboard accessible (Tab, Enter/Space, Escape, Arrow Up/Down)
  • Toolbar (right): search box, native-nav toggle, optional license debug

Mobile (≤ 768 px)

Hamburger + slide-out drawer

  • Hamburger button (GlobalNavButton icon) opens the drawer
  • Drawer header shows logo slot, title, mobile app-bar toggle, and Close
  • Full-height slide-out drawer with backdrop overlay
  • Expandable accordion (ChevronDown / ChevronUp) for nested items
  • Separate Forward button on items that have both a URL and children (tap to navigate instead of expand)
  • SharePoint's header navigation is always hidden on mobile
  • Optional mobile search icon opens a full-width search overlay

Required Navigation List

Mega Menu reads navigation items from a SharePoint list. The default list name is MegaMenuNavigation, but this can be configured in the extension properties.

List Schema

ColumnInternal NameTypeRequiredDescription
TitleTitleSingle line of textYesDisplay text for the menu item
URLURLHyperlink (or Text)RecommendedNavigation URL (relative or absolute). Missing URLs resolve to #. Hyperlink {Url, Description} objects and plain strings are both supported.
ParentAuto-detectedLookup (to same list)NoParent item for hierarchy. Internal name varies (e.g., ParentId, ParentIdId); Mega Menu auto-detects any field whose lowercased name contains "parent" and ends with "id".
Sort OrderSortOrderNumberRecommendedDisplay order within the same level. Defaults to 0 when missing. Use increments of 10 for easier insertion later.
Open In New TabOpenInNewTabYes/NoNoOpen link in new browser tab. Accepts true, "TRUE", "true", "Yes", or "1".
IconIconSingle line of textNoFluent UI icon name (e.g., "Home", "People")
Is EnabledIsEnabledYes/NoNoShow/hide item. Defaults to Yes. Items set to No are filtered out of the tree.

Create the Parent lookup column

When creating the Parent column, set it as a Lookup to the same list (MegaMenuNavigation), using the Title column as the display field. The internal name varies by tenant, and Mega Menu auto-detects it.

Step-by-Step Setup

1

Create the navigation list

Go to Site Contents → New → List. Name it "MegaMenuNavigation" (exact spelling matters for default configuration).
2

Add the URL column

Add a column: Name = "URL", Type = Hyperlink. This stores the navigation destination.
3

Add the SortOrder column

Add a column: Name = "SortOrder", Type = Number. This controls display order within each level.
4

Add the Parent lookup column

Add a column: Name = "Parent", Type = Lookup. Select "MegaMenuNavigation" as the source list, "Title" as the display column.

SharePoint generates the internal name automatically; Mega Menu auto-detects it.

5

Add optional columns

Add OpenInNewTab (Yes/No), Icon (Text), and IsEnabled (Yes/No) columns as needed.
6

Create Level 1 items first

Add your root navigation items. Leave Parent empty and set SortOrder (1, 2, 3, etc.).
7

Create Level 2 items

Add second-level items. Select their parent from the Parent dropdown and set SortOrder.
8

Create Level 3 items (optional)

Add third-level items, selecting Level 2 items as their parents.

Maximum depth is 3 levels. Items with deeper nesting will be ignored.

9

Add the Bonzai app to your site

Go to Site Contents → New → App. Find "Bonzai 2" in the app list and click Add. This is a separate step from uploading the package to the App Catalog.

The Bonzai package must first be uploaded to your tenant App Catalog. Then you add it to each site where you want to use Mega Menu.

10

Navigate your site

Visit any page on your site. The Mega Menu should appear in the header, replacing or supplementing native navigation.
11

Toggle native navigation (optional)

Click the chevron button on the right side of the menu bar to show/hide SharePoint's native navigation.

Common Configurations

Example navigation structures:

Simple 2-Level Menu

Basic navigation with departments

Best for: Small to medium sites
Configuration
Level 1Home, About, Services, Contact
Level 22-3 items per Level 1
Level 3Not used
IconsOptional

Department Hub

Multi-department navigation

Best for: Large intranet sites
Configuration
Level 1HR, IT, Finance, Operations
Level 2Policies, Tools, Team, FAQs per dept
Level 3Specific pages/links
IconsPeople, Settings, Money, Gear

Full 3-Level Structure

Deep navigation hierarchy

Best for: Complex sites with many pages
Configuration
Level 15-8 main sections
Level 23-6 subsections each
Level 32-5 pages per subsection
External LinksOpenInNewTab = Yes

Best Practices

Use consistent SortOrder numbering

Use increments of 10 (10, 20, 30) instead of 1, 2, 3. This makes it easy to insert items later without renumbering everything.

Keep Level 1 concise

Limit top-level items to 5-8 entries. Too many Level 1 items create a cluttered horizontal bar that may wrap on smaller screens.

Use IsEnabled for seasonal items

Instead of deleting temporary menu items (like "Holiday Schedule"), set IsEnabled to No. This preserves the item for future use.

Test on mobile devices

The mobile drawer handles deep hierarchies differently than desktop. Test on actual mobile devices or browser responsive mode.

Navigation caches for 5 minutes

The Mega Menu caches navigation data for performance. Changes to the list may take up to 5 minutes to appear. Clear browser cache for immediate testing.

Multi-Site Deployments (Shared Navigation)

If you have multiple sites or subsites that should share the same Mega Menu, you do not need to create a MegaMenuNavigation list on each subsite. There are two mechanisms that cooperate here:

  1. Automatic fallback to the site collection root. If the MegaMenuNavigation list does not exist on the current subsite, the Navigation Service transparently retries the request against pageContext.site.absoluteUrl (the site collection root). This means a single list on the root site works for every subsite out of the box.
  2. Explicit override via Theme Manager. Theme Manager's Navigation Source Site URLsetting lets you point any site/subsite to a specific site URL that holds the navigation list. This is useful when the navigation list lives outside the current site collection, or when you want to force a particular source without relying on the automatic fallback.

Set up shared navigation in Theme Manager

On each subsite, open Theme Manager and enter the source site URL (e.g., https://tenant.sharepoint.com/sites/intranet) in the "Navigation Source Site URL" field under Navigation Source. Save with "Persist to Site" enabled. The Mega Menu (and Footer) will fetch their lists from that site instead of the current web.

Root site setup

On the root site where the MegaMenuNavigation list lives, leave Navigation Source Site URL empty in Theme Manager. Empty means "use this site" — the default behavior. The navigation list is cached for 5 minutes per source URL + list name combination.

Troubleshooting

Still need help? Contact Bonzai Support


Reference

Technical details for developers and advanced users.

Extension Properties

PropertyTypeDefaultDescription
navigationListNameTextMegaMenuNavigationName of the SharePoint list containing navigation items
hideNativeNavigationBooleantrueHide SharePoint's native site navigation
hideMobileAppBarBooleantrueHide SharePoint's mobile sticky footer app bar
showBreadcrumbBooleantrueShow breadcrumb navigation below the menu bar
licenseApiUrlText(empty)Optional override for the Bonzai license validation API endpoint. Leave empty to use the default.
enableLicenseDebugBooleanfalseOptional. When true, a license test panel appears next to the nav toggle so you can simulate Active / Warning / Expired states. Intended for testing only.

CSS Customization

Mega Menu reads Theme Manager branding values as CSS custom properties. Background, foreground, hover background, and hover foreground are each configured explicitly in Theme Manager's Mega Menu Branding section — hover colors are not derived. Additional variables are emitted for navigation/dropdown spacing scales, breadcrumb alignment, and breadcrumb inset.

Keyboard Navigation

KeyAction
TabMove between Level 1 items
Enter / SpaceOpen mega menu panel for current item
EscapeClose open panel
Arrow DownOpen submenu if item has children
Arrow UpClose submenu

Features Checklist

  • 3-level hierarchical navigation (levels beyond 3 are skipped)
  • Desktop: horizontal bar with hover-triggered mega menu panels (50 ms enter / 400 ms leave)
  • Mobile: hamburger button with full-height slide-out drawer and backdrop
  • SharePoint list-driven (centrally managed MegaMenuNavigation list)
  • Automatic fallback to the site collection root when the list is missing on a subsite
  • Shared navigation across sites via Theme Manager Navigation Source Site URL
  • Optional Fluent UI icons on menu items (via Icon column)
  • Optional breadcrumb with site-collection/subsite ancestry and SPA-aware updates
  • Open-in-new-tab option per item (accepts boolean or common string values)
  • Enable/disable individual items without deleting (IsEnabled)
  • Toggle to show/hide native SharePoint navigation (desktop)
  • Toggle to show/hide SharePoint mobile sticky-footer app bar
  • SharePoint's header navigation is always hidden on mobile
  • Page Layout Fix: hide left sidebar and center content on CMSPUBLISHING sites
  • Optional mega menu search with four tabs (All / Documents / People / Locations), hit highlighting, 60-second result cache, 8-second timeout, and multi-source people fallback (SharePoint Search → Microsoft Graph)
  • License validation host: whitelist bypass, stale-while-revalidate caching, Active/Warning/Expired/Unknown banners
  • Keyboard accessible (Tab, Enter/Space, Escape, Arrow Up/Down) with ARIA roles
  • 5-minute in-memory navigation cache (per source URL + list name)
  • Theme Manager integration: 4-color picker, logo URL, spacing sliders, breadcrumb controls, search settings, page layout fix
  • Responsive design — breakpoint at 768 px

Page Layout Fix

Some SharePoint sites — particularly sub-sites created with the CMSPUBLISHING web template — display a left sidebar panel that takes up space even when the Mega Menu's “Hide native navigation” setting is active. Additionally, Bonzai's full-width canvas zones can cause page content to appear left-aligned instead of centered.

The Page Layout Fix addresses both issues through the Theme Manager, without requiring a separate package or PowerShell scripts.

How to Enable

  1. Open the Theme Manager web part (edit your homepage)
  2. Scroll to the Mega Menu Branding section
  3. Toggle “Enable Page Layout Fix” to ON
  4. Optionally adjust the sub-toggles:
    • Hide Left Sidebar — removes the native SharePoint left navigation panel (recommended for CMSPUBLISHING sub-sites)
    • Center Page Content — re-centers page content that full-width zones push left
  5. Click Save Theme
  6. Hard refresh the page (Ctrl+Shift+R) to verify

Off by default

The Page Layout Fix is disabled by default and has zero visual impact until you explicitly enable it. This is safe to deploy to all sites — it only takes effect where an admin turns it on.

When do you need this?

Enable this if you see a left sidebar panel on your site that won't go away, or if your page content appears left-aligned instead of centered. This is most common on CMSPUBLISHING sub-sites (e.g., department sites created as publishing sites).

What It Does

SettingEffectDefault
Enable Page Layout FixMaster toggle — activates/deactivates the featureOFF
Hide Left SidebarRemoves the native SharePoint left navigation panel and collapses its spaceON (when fix is enabled)
Center Page ContentRe-centers page content and the comments section below itON (when fix is enabled)

Replacing the standalone center-fix package

If your site previously used the separate bonzai-center-fix package (deployed via PowerShell), you should remove that package after enabling the built-in Page Layout Fix. Having both active is harmless but unnecessary. Ask your SharePoint admin to remove the old custom action from the site.

Migration from Classic Bonzai

The Mega Menu in Bonzai 2 provides similar navigation functionality to Classic Bonzai, rebuilt as a modern SPFx Application Customizer. Key improvements include responsive mobile drawer, keyboard accessibility, and SharePoint list-based configuration instead of master page customization.