How to Build a Mega Menu in Divi 5 (No Plugin)

November 25, 2026 | Divi 5 Guides

Build a Divi 5 mega menu with native Interactions: a full width panel on hover, a sticky header and a phone menu. With screenshots and a free sample file.

On this page

Free Divi 5 layouts

Heroes, pricing tables, footers and more, built with native modules.

A Divi 5 mega menu needs no plugin. The parts are already in the builder: Groups for the layout, Position Fixed to place a full width panel under the header, and Interactions to open it when a visitor hovers a menu item and close it when they leave. In this guide we build one from scratch in a Theme Builder header: a Products item that opens a three column panel, plain links beside it, a sticky bar, and a separate menu for tablets and phones.

A Divi 5 mega menu open under a white header, with two columns of product links and a feature card
The finished mega menu. Hovering Products opens the panel; moving the mouse away closes it.

Want to skip the build? Download the sample header (a free Divi 5 JSON file, 7 KB, zipped) and import it. It holds the whole header from this guide, with plain colours and no presets, so it does not touch your global colours.

How the mega menu works

The Divi Menu module draws its dropdowns from a WordPress menu, so it can only show links. A mega menu needs more: columns, icons, a card. So instead of the Menu module, the header is built from Groups, and each menu item is a Group of its own.

The trick is where the panel sits. It goes inside the Products menu Group, not after it. Mouse Leave only fires when the cursor leaves the Group and everything inside it, so a visitor can move from the word Products down onto the panel and it stays open. Move off both, and it closes.

Step 1: Add a header in the Theme Builder

Go to Divi, Theme Builder. To show the menu on every page, click Add Global Header on the Default Website Template, then Build Global Header. On any other template the button says Add Custom Header. The Visual Builder opens with an empty header.

The Divi 5 Theme Builder with the Add Custom Header button highlighted on a template
Add the header to the template that should show the menu.

Step 2: Build the bar

Add a section with a one column row. Set the row to 100% width so the panel can span the screen later. In the column, add a Group named "Bar": Layout set to a row with its items centered and spaced between, a width of 90% with a maximum of 1216px, and a height of 72px. That 72px matters: the panel will open exactly there.

Inside the Bar go three things: your logo, a Group named "Nav" for the menu items, and a Group for the Sign in link and the button. Give every Group a clear admin label. You will pick modules by name in the Interactions settings, and "Products panel" is much easier to find than the fifth "Group".

One more setting on the way: on the section, the row, the column, the Bar and the Nav, set Horizontal Overflow and Vertical Overflow to Visible (Advanced tab, Visibility). The sample header does this so nothing around the panel can cut it off.

Step 3: Make the Products menu item

In the Nav, add a Group named "Products menu" with its height set to 72px, the same as the bar. Inside it, put a Text module with the word Products and a small chevron icon. Because the item is as tall as the bar, its bottom edge touches the top of the panel, and the cursor never crosses a gap on the way down.

The other menu items, like Pricing or Docs, are just Text modules with a link. Only items that open a panel need to be Groups.

Step 4: Build the panel and fix it under the bar

Inside the Products menu Group, after the label, add a Group named "Products panel". Fill it however you like. Ours holds an inner Group (90% wide, 1216px max, so it lines up with the bar) with two columns of links, each an icon tile, a title and one line of text, plus a tinted feature card. Then place it:

  • Advanced, Position: Fixed, offset origin top left, Vertical Offset 72px, Horizontal Offset 0, Z Index 10.
  • Design, Sizing: width 100%.
  • Design: a white background, a 1px top border and a soft shadow, so it reads as a layer over the page.
Divi 5 Position settings of the Products panel group set to Fixed with a 72px vertical offset
The Products panel: Position Fixed, 72px from the top, Z Index 10.

Good to know When you are logged in, the WordPress admin bar pushes the whole page down by 32px, so the panel opens a little high and overlaps the bar. Your visitors never see that. If you want it exact for logged in users too, use calc(72px + var(--wp-admin--admin-bar--height, 0px)) as the Vertical Offset, as in the screenshot. Divi shows "Invalid unit is being used for calculation" under the field, but the front end uses the value correctly: we checked the panel's position in the browser.

Step 5: Open and close it with Interactions

Select the Products menu Group (not the panel), open the Advanced tab and find Interactions. Click Add Interaction four times, each with Target Module set to the Products panel:

  1. Trigger Event Load, Effect Action Hide Element. The panel starts closed.
  2. Trigger Event Mouse Enter, Effect Action Show Element. Hovering opens it.
  3. Trigger Event Mouse Exit, Effect Action Hide Element. Leaving closes it.
  4. Trigger Event Click, Effect Action Show Element. A tap opens it on touch screens.
Divi 5 Edit Interaction with Trigger Event Mouse Enter, Effect Action Show Element and the Products panel as target
The four interactions on the Products menu group, with the Mouse Enter one open.

Use Show Element for the click, not Toggle Visibility. On a desktop the hover has already opened the panel by the time the visitor clicks, so a toggle would close it again right under their cursor. We ran into exactly that while testing.

Step 6: Add a quick fade

On the Products panel, open Design, Animation and pick Fade with a duration of about 200ms. Divi replays an element's entrance animation each time an interaction shows it, so the panel fades in on every hover instead of snapping open. Keep it short: a menu should feel instant.

Step 7: Make the header sticky

Select the section and open Advanced, Scroll Effects. Set Sticky Position to Stick to Top and leave the offset at 0. Give the section a Z Index of 1000 under Advanced, Position, so it stays above the page as it scrolls. Because the bar is now always at the top of the screen, the panel, fixed at 72px, always lands right under it.

Divi 5 Scroll Effects of the header section with Sticky Position set to Stick to Top
The header section: Sticky Position set to Stick to Top.

Step 8: Add the tablet and phone menu

Hover does not exist on a phone, and a 1440px panel would not fit anyway. So the small screen version is a menu button and a drawer:

  • On the Nav and the Sign in link, open Advanced, Visibility and tick tablet and phone under Disable on.
  • Add a Group named "Menu button" to the bar with two icons in it, a menu icon and an X. Under Disable on, tick desktop.
  • Under the Bar, in the same column, add a Group named "Mobile menu" with your links in a list, one row each. Disable it on desktop.
  • On the Menu button, add five interactions: Load, Hide Element on the Mobile menu and on the X icon; then Click, Toggle Visibility on the Mobile menu, the menu icon and the X icon. A tap opens the drawer and swaps the icon to an X; a second tap closes it.
Divi 5 interactions on the menu button: two Load Hide Element and three Click Toggle Visibility
The Menu button and its five interactions.

We left the drawer in the normal flow under the bar rather than fixing it to the screen. It pushes the page down when it opens, so on a short phone screen nothing gets cut off. For the Products row in the drawer, the same Toggle Visibility trick works on a smaller scale: a click on the row shows or hides the list of product links under it.

The Divi 5 mega menu on a phone, with the drawer open and the Products links expanded
On a phone, the menu button opens a drawer instead of the panel.

Step 9: Save and test

Save the header, then save the Theme Builder. Interactions do not run inside the Visual Builder (the panel just sits there open so you can edit it), so test on the live page. Hover Products, move onto the panel, move away, and scroll down and hover again. Then shrink the window, or open the page on a phone, and try the menu button.

If something does not work

  • The panel closes on the way down to it. The panel is not inside the Products menu Group, or the menu item is shorter than the bar and leaves a gap. Drag the panel into the Group and match the heights.
  • The panel opens in the wrong place. Check that its Position is Fixed with the offset origin at the top left, and that its Vertical Offset equals the height of your bar.
  • The panel is visible as soon as the page loads. The Load, Hide Element interaction is missing or points at another module.
  • The panel opens behind the page content. Give the header section a Z Index of 1000 and the panel 10.

Download and import the sample header

Download the sample header and unzip it. Inside is one file, divi-5-mega-menu.json, exported with Divi 5's own Import & Export.

  1. In the Theme Builder, add a new header as in Step 1 and open it in the Visual Builder.
  2. Click the gear icon at the top left and choose Import.
  3. Choose the JSON file and click Import Layout, then Save, and save the Theme Builder.

We tested the file both ways: imported into a Theme Builder header and into a normal page. Replace Pagecraft, the links and the panel text with your own, and change the indigo to your brand colour.

Start from a ready design

Need more than one panel? Our free Divi 5 header layouts use this same method. The Payments Mega Menu has three panels and a dimmed page behind them, and the Consulting Navy Mega Menu keeps it to plain columns of links. For a popup built the same way, see how to create a popup in Divi 5 on button click, and if importing is new to you, here is how to import a Divi 5 layout.