Mega Menu
3-level hierarchical navigation with desktop mega menu panels and mobile drawer.
This is an Application Customizer, not a web part
Two-step activation required
License banner awareness
Legacy package note
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.
- Open the App Catalog site:
https://<tenant>.sharepoint.com/sites/appcatalog - Go to Site Contents → Tenant Wide Extensions
- Click New → Application Customizer
- 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 blankMatch the feature element defaults
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
Prerequisites
- Bonzai 2 package (.sppkg) uploaded to your tenant App Catalog
- Site Collection Administrator permissions on your target site
- Understanding of SharePoint list creation
Create the Navigation list
Create a SharePoint list named "MegaMenuNavigation" with the required columns (see schema below).
Add your navigation items
Create list items for your menu hierarchy: Level 1 items have no parent, Level 2/3 items reference their parent.
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.
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:
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
/usersif 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-livescreen-reader announcements of result counts,aria-activedescendantfocus 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 separatebonzai-center-fixSPFx 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
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_layoutsare stripped; date prefixes (e.g.,2026-01-) are removed; and hyphens/underscores become spaces with title-casing. - Current page label: uses
pageContext.listItem.titlewhen 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
popstateand 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:
Root navigation items displayed in the horizontal menu bar. Click or hover to open Level 2 panel.
Second-level items displayed in the dropdown mega menu panel. Can have Level 3 children.
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
| Column | Internal Name | Type | Required | Description |
|---|---|---|---|---|
| Title | Title | Single line of text | Yes | Display text for the menu item |
| URL | URL | Hyperlink (or Text) | Recommended | Navigation URL (relative or absolute). Missing URLs resolve to #. Hyperlink {Url, Description} objects and plain strings are both supported. |
| Parent | Auto-detected | Lookup (to same list) | No | Parent 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 Order | SortOrder | Number | Recommended | Display order within the same level. Defaults to 0 when missing. Use increments of 10 for easier insertion later. |
| Open In New Tab | OpenInNewTab | Yes/No | No | Open link in new browser tab. Accepts true, "TRUE", "true", "Yes", or "1". |
| Icon | Icon | Single line of text | No | Fluent UI icon name (e.g., "Home", "People") |
| Is Enabled | IsEnabled | Yes/No | No | Show/hide item. Defaults to Yes. Items set to No are filtered out of the tree. |
Create the Parent lookup column
Step-by-Step Setup
Create the navigation list
Add the URL column
Add the SortOrder column
Add the Parent lookup column
SharePoint generates the internal name automatically; Mega Menu auto-detects it.
Add optional columns
Create Level 1 items first
Create Level 2 items
Create Level 3 items (optional)
Maximum depth is 3 levels. Items with deeper nesting will be ignored.
Add the Bonzai app to your site
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.
Navigate your site
Toggle native navigation (optional)
Common Configurations
Example navigation structures:
Simple 2-Level Menu
Basic navigation with departments
| Level 1 | Home, About, Services, Contact |
| Level 2 | 2-3 items per Level 1 |
| Level 3 | Not used |
| Icons | Optional |
Department Hub
Multi-department navigation
| Level 1 | HR, IT, Finance, Operations |
| Level 2 | Policies, Tools, Team, FAQs per dept |
| Level 3 | Specific pages/links |
| Icons | People, Settings, Money, Gear |
Full 3-Level Structure
Deep navigation hierarchy
| Level 1 | 5-8 main sections |
| Level 2 | 3-6 subsections each |
| Level 3 | 2-5 pages per subsection |
| External Links | OpenInNewTab = Yes |
Best Practices
Use consistent SortOrder numbering
Keep Level 1 concise
Use IsEnabled for seasonal items
Test on mobile devices
Navigation caches for 5 minutes
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:
- Automatic fallback to the site collection root. If the
MegaMenuNavigationlist does not exist on the current subsite, the Navigation Service transparently retries the request againstpageContext.site.absoluteUrl(the site collection root). This means a single list on the root site works for every subsite out of the box. - 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
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
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.Reference
Technical details for developers and advanced users.
Extension Properties
| Property | Type | Default | Description |
|---|---|---|---|
navigationListName | Text | MegaMenuNavigation | Name of the SharePoint list containing navigation items |
hideNativeNavigation | Boolean | true | Hide SharePoint's native site navigation |
hideMobileAppBar | Boolean | true | Hide SharePoint's mobile sticky footer app bar |
showBreadcrumb | Boolean | true | Show breadcrumb navigation below the menu bar |
licenseApiUrl | Text | (empty) | Optional override for the Bonzai license validation API endpoint. Leave empty to use the default. |
enableLicenseDebug | Boolean | false | Optional. 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
| Key | Action |
|---|---|
| Tab | Move between Level 1 items |
| Enter / Space | Open mega menu panel for current item |
| Escape | Close open panel |
| Arrow Down | Open submenu if item has children |
| Arrow Up | Close 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
MegaMenuNavigationlist) - 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
Iconcolumn) - 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
- Open the Theme Manager web part (edit your homepage)
- Scroll to the Mega Menu Branding section
- Toggle “Enable Page Layout Fix” to ON
- 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
- Click Save Theme
- Hard refresh the page (Ctrl+Shift+R) to verify
Off by default
When do you need this?
What It Does
| Setting | Effect | Default |
|---|---|---|
| Enable Page Layout Fix | Master toggle — activates/deactivates the feature | OFF |
| Hide Left Sidebar | Removes the native SharePoint left navigation panel and collapses its space | ON (when fix is enabled) |
| Center Page Content | Re-centers page content and the comments section below it | ON (when fix is enabled) |
Replacing the standalone center-fix package
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.