How To Build Custom Sidebar Navigation With Divi 5 Interactions

by | Apr 29, 2026 | Etcetera | 0 comments

Aspect navigation is a well-recognized trend as it helps to keep the principle header easy whilst nonetheless creating a complete menu to be had when wanted. It is not uncommon on cellular, however it will possibly additionally paintings neatly on desktop when a design requires a minimum header with a symbol and hamburger icon.

Subscribe To Our Youtube Channel

Divi 5 brings a couple of local options in combination to make this sort of structure imaginable. The Theme Builder handles the worldwide header, an international Canvas shops the off-canvas sidebar, and Interactions keep an eye on the open and shut habits between them.

On this educational, we’ll construct a minimum best header with a symbol and hamburger icon. Then we’ll create a separate sidebar panel as an international Canvas, whole with a dynamic menu powered by way of the Loop Builder, a CTA button, and social icons. In any case, we’ll cover the sidebar by way of default and use Interactions to toggle it from each the hamburger icon and the shut icon. Design Variables will stay shared values constant, and Custom Attributes will assist upload fundamental accessibility metadata.

How The Items Are compatible In combination

Ahead of construction, it is helping to grasp the construction. This educational makes use of two canvases.

The Primary Canvas is the worldwide header template within the Theme Builder. It seems that around the website and accommodates the mounted best header with a symbol and hamburger icon.

The World Canvas is a separate reusable Canvas named Sidebar Navigation. It accommodates the sidebar panel, together with a greeting bar with a detailed icon, a symbol, a looped menu, a CTA button, and social icons.

As soon as each canvases are constructed, the sidebar Canvas is appended to the principle canvas. The sidebar Phase is hidden by way of default, and the hamburger icon in the principle header will get a click on Interplay that toggles it open. The shut icon throughout the sidebar will get an identical click on Interplay that toggles it closed.

Design Variables

Open the Design Variable Supervisor from the continual left sidebar. The next variables strengthen this construct. If you have already got an identical variables to your design machine, use the ones as a substitute. You’ll be able to additionally use static values immediately within the modules for those who don’t seem to be operating with variables but.

Colour Variables

  • Number one Colour: #00c673. Used for the Sign up for Nowadays button, the sidebar greeting bar, and menu hyperlink hovers.
  • Black: #000000. Used for hover states, default icon colour, and menu hyperlink textual content.
  • Background – Gentle Grey: #f5f5f5. Used as the sunshine gradient forestall within the header and sidebar backgrounds.
See also  How to Use the Reviews by Product WooCommerce Block

Quantity Variables

  • Spacing – Small: 20px. Used for sidebar spacing and inner padding.
  • Row Max Width: 1080px. Used as a reusable structure width price the place wanted.

Symbol Variable

  • Emblem Darkish: Add your website’s darkish emblem record. This can be utilized by each the principle header emblem and the sidebar emblem.

String Variable

  • Sign up for Nowadays: “Sign up for Nowadays.” This can be used because the CTA button label.

Phase 1: The Primary Canvas World Header

Open the Theme Builder from the WordPress admin and create or edit your world header template. The whole lot on this section lives throughout the Phase that makes up the principle header.

The Fastened Header Phase

Upload a Phase. Open the Background choice team and follow a linear gradient background. Set the primary forestall at 0% to clear White and the second one forestall at 100% to #f5f5f5, or your Background – Gentle Grey variable. This creates a comfortable fade from clear on the best to mild grey on the backside.

Within the Spacing choice team, set desktop padding to 10px best and 10px backside. Depart horizontal padding on the default.

Row And Column

Within the Phase, upload a Row the use of the Equivalent Columns 1 structure. Upload an Symbol module to the row’s unmarried column and assign your emblem. Set the picture width to 50px. Then upload an Icon module to the similar column.

Within the Column’s Format choice team, set Flex Course to row, Justify Content material to space-between, and Align Pieces to middle. This puts the brand at the left and the hamburger icon at the proper, with each parts targeted vertically.

The Hamburger Icon

For the Icon module, select a hamburger icon from the icon picker. Within the icon settings, set the desktop colour to #000000, or your Black variable, and set the dimensions to 35px.

As a result of this icon will act like a button, upload useful attributes within the Complicated tab. Within the Attributes choice team, upload position with the worth button and aria-label with the worth Open navigation menu.

Save the header template. The principle canvas is whole: a minimum mounted header with a symbol at the left, a hamburger icon at the proper, and a comfortable gradient background.

Phase 2: The World Canvas Sidebar Panel

Open the Canvas view and create a brand new world Canvas. Title it Sidebar Navigation. A world Canvas is reusable around the website, which makes it a excellent are compatible for an off-canvas navigation panel. Append it to the Primary Canvas and set the Z Index to 999.

Within the Design tab, open the Sizing choice team. Set the desktop Width to 250px and the Peak to 100vh. This provides the sidebar a set width and whole viewport top.

Within the Complicated tab, open the Place choice team. Set the placement mode to Fastened and position it on the best proper on desktop. This pins the sidebar to the fitting fringe of the viewport.

Then, within the Background choice team, follow the similar gradient as the principle header: White at 0% and #f5f5f5, or your Background – Gentle Grey variable, at 100%.

Within the Format choice team, set Horizontal Hole to 10px on desktop. Within the Spacing choice team, set desktop padding to 0px best and 10px backside. Depart the horizontal padding unset.

Then, within the Complicated tab, open the Attributes choice team and upload two attributes: position with the worth navigation, and aria-label with the worth Sidebar navigation. Those supply fundamental context for assistive applied sciences. Should you adapt this trend into a real modal menu, additionally take a look at keyboard center of attention, get away habits, and center of attention go back.

See also  7 Most Fun WordPress Plugins

Row 1: The Greeting Bar And Shut Icon

Within the Phase, upload a Row. This would be the best bar of the sidebar, retaining a brief greeting and the shut icon.

Within the Row’s Content material tab, open the Background choice team and set the desktop background colour to #00c673, or your Number one Colour variable. Set the hover background colour to #000000, or your Black variable.

Within the Sizing choice team, set Width to 100% and Max Width to none on desktop so the row spans the entire sidebar width. Then, within the Spacing choice team, set the highest and backside padding to 10px on desktop.

Within the column, upload a Heading Module. Set the textual content to Useful assets since 2009. or your personal greeting. Set the heading degree to h4, font dimension to 14px, line top to 1.3em, and colour to #ffffff.

Within the Heading’s Complicated tab, open the Customized CSS choice team and upload the next to the Primary Part:

text-wrap: steadiness;

This CSS assets is helping steadiness textual content throughout strains, which is able to cut back awkward line breaks briefly headings.

Underneath the heading, however in the similar row and column, upload an Icon module. Within the icon picker, make a selection the shut X icon. Set the desktop colour to #ffffff and the dimensions to 35px.

Within the icon’s Complicated tab, open the Attributes choice team and upload position with the worth button, and aria-label with the worth Shut navigation menu. Because the icon isn’t a local button part, those attributes assist explain its objective.

We’ll configure the interplay in this icon later. For now, go away it unconfigured.

Row 2: The Sidebar Frame

Upload a 2d single-column Row beneath the greeting bar. This row holds a Workforce module with the brand and menu. After that team, we’ll upload the CTA button and social icons.

Within the Row’s Sizing choice team, allow Develop to Fill. Do the similar at the Workforce module, and take away Shrink to Are compatible. Within the Workforce module, set the Format alignment to Middle.

For the Symbol module, set the supply to the Emblem Darkish design variable. Set Hyperlink URL to the House URL. Within the Design tab, set Max Peak to 48px underneath Sizing, then set the picture alignment to middle.

Subsequent, configure the Hyperlink module that can turn into the dynamic menu. Within the hyperlink font settings, set the desktop colour to Black, the font weight to Semibold, and the hover colour in your Number one Colour.

Within the Hyperlink module’s Content material tab, open the Loop choice team. Permit looping, set Question Sort to Menu, and select Number one Menu. Then set the module textual content to Loop Menu Textual content and the hyperlink URL to Loop Menu Hyperlink, each thru Dynamic Content material.

Taste the Button module alternatively you favor. On this instance, the button makes use of Number one Colour for the background, Black on hover, white textual content, border radius, and customized padding. Set the button textual content to the Sign up for Nowadays string variable. Underneath Design > Alignment, set it to Middle.

See also  Bluehost Managed WordPress Hosting Review

Within the Social Media Observe module’s Design tab, open the Format choice team and set Justify Content material to Middle. Then take away the background colours underneath Content material > Background and set each and every icon colour to Black.

Phase 3: Twine Up The Toggle Interactions

Interactions in Divi 5 paintings thru triggers, results, and goals. A module fires a cause, equivalent to a click on. The objective part responds with an impact, equivalent to display, cover, toggle visibility, or some other supported motion. On this case, we’d like two interactions: one to open the sidebar and one to near it.

Interplay 1: The Hamburger Icon Opens The Sidebar

Go back to the principle canvas and make a selection the hamburger Icon module. In its Complicated tab, open the Interactions choice team and upload a brand new interplay with those settings:

  • Cause: Click on
  • Impact: Toggle Visibility
  • Goal: World Canvas Phase, pointing to the sidebar Phase

When any person clicks the hamburger icon, Divi toggles the sidebar’s visibility.

Interplay 2: The Shut Icon Closes The Sidebar

Make a selection the shut X Icon module throughout the sidebar’s first row. In its Complicated tab, open the Interactions choice team and upload an interplay with the similar configuration:

  • Cause: Click on
  • Impact: Toggle Visibility
  • Goal: The similar World Canvas Sidebar Phase

Subsequent, make a selection the sidebar Phase. That is the Phase you constructed throughout the world Canvas, now visual inside of the principle canvas as a referenced segment. Within the Phase’s Complicated tab, open the Visibility choice team and disable it on desktop, pill, and telephone. This helps to keep the sidebar hidden till an interplay finds it.

Get started Development In Divi 5 Nowadays!

The actual price of this construct isn’t just the sidebar itself. It’s the two-canvas-plus-interaction trend. The principle canvas holds what’s at all times visual. The worldwide Canvas holds what seems simplest when induced. An Interplay makes a decision when to turn or cover it.

That very same trend can strengthen greater than sidebar navigation. Change the sidebar content material with a buying groceries cart abstract, and you’ve got a cart drawer. Change it with a login shape, and you’ve got a easy account panel. Change it with a statement, and you’ve got a slide-in promo space. The construction can keep in large part the similar whilst the content material adjustments.

When you’ve got been looking forward to a sensible reason why to take a look at Divi 5, the mix of worldwide Canvases, Interactions, and the Loop Builder is a robust one. You’ll be able to construct interactive navigation patterns immediately within the Visible Builder, with out customized JavaScript or additional plugins.

The put up How To Build Custom Sidebar Navigation With Divi 5 Interactions gave the impression first on Elegant Themes Blog.

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!