Skip to Content
Solodev Logo
  • Platform

    AI

    Chat, agents and CMS tools

    Websites

    Launch and manage your websites

    Pages

    Reusable layouts and publishing

    Modules

    Structured, reusable content

    Forms

    Capture and review submissions

    Organization

    SSO, users and permissions

    Tasks

    Assignments, reviews and follow-up

    API

    Connect content and integrations

    Mobile
    Drive your entire digital presence with Solodev CMS
    Request a Demo
    Platform Preview
  • Pricing
  • Enterprise
  • Marketplace
Sign In Sign In Sign Up
Solodev Logo
Close Icon
  • Platform Angle right icon
    • Websites
    • Forms
    • Pages
    • API
    • Modules
    • Mobile
    • Collaboration
    • AI
  • Pricing
  • Explore Angle right icon
  • Careers Angle right icon
  • Contact Us Angle right icon
  • Connect

Terms

Privacy Policy

How to Create an Expandable Sidebar Navigation Links


Do your navigational elements do too much? Offset potentially overwhelming menus by using an expansive sidebar for an added navigational element.

How to Create an Expandable Sidebar Navigation Links
Build the perfect cloud stack today. Shop the Marketplace.

Navigation is a critical part of UX design, but sometimes, there are so many navigation options that's things like mega menus simply aren't functional. In those moments, it's often easier to break up the navigational elements as to not overwhelm a user. 

Such moments can become quite apparent when using navigational links in your template's sidebar, aside, or other secondary template element. A unique way to streamline, but still include all necessary links, in your sidebar navigation is to make your primary, top-level links expandable/collapsible. With this method, users can clearly get to the links and sections they need, and yet you preserve your design and prevent long lists from displaying by default.

With this tutorial, you will get all of the needed HTML, CSS, and JS to create these expandable/collapsible navigational elements.

HTML

The HTML here uses un-ordered, un-styled list within another to specify where to put the sub-items.

CSS

Some general styles for the navigation.

JS

The Javascript/jQuery code here uses DOM traversing and matchHeight to give the elements the desired functionality when we want them.

Want to see how this tutorial could look on your site before you invest the time in coding? Try it out first in the JSFiddle below! Make sure to click on each element to see how the expand/collapse functionality looks.


Share on Facebook Tweet It

Scott Madara
Contributions Editor here at Solodev. Want to be featured on the Solodev Blog? Get in touch.
Follow me on Twitter

RELATED POSTS

How to Make your Hero Image the Hero of your Webpage

How to Make your Hero Image the Hero of your Webpage

Three Common Website Issues and How to Survive Them

Three Common Website Issues and How to Survive Them

Five Tips to Building Landing Pages that Convert

Five Tips to Building Landing Pages that Convert

How to Edit Meta Information with your Solodev Website

How to Edit Meta Information with your Solodev Website

  • web design
    • Bootstrap
    • Form Tutorials
    • Navigation
    • Search
    • Sliders
    • Social
  • digital marketing
  • solodev
    • API
    • User Permissions
  • customer experience
  • accessibility
  • seo
  • analytics
  • sem

Sign up to explore

Create an account in seconds and start building today.

Sign up for Solodev

Join the list

Get the latest updates on cloud, AI, and more.

Community

Connect with Solodevs across the social universe

Solodev Logo footer

Build websites, manage content, and connect AI with Solodev CMS. Bring your websites, pages, modules, forms, organization, and tasks together, with managed hosting or deployment in your own Cloud Account.

Platform

  • AI
  • Websites
  • Pages
  • Modules
  • Forms
  • Organization
  • Tasks
  • API
  • Mobile

Explore

  • Pricing
  • Public Sector
  • Enterprise

Company

  • About Us
  • Blog
  • Contact Us
  • Subscribe

©2026 Solodev. All rights reserved worldwide.

Terms Privacy Policy
Solodev logo
GET STARTED

Fill out the form to speak with a Solodev Advisor

 

We use cookies to provide and improve our services. By using our site, you consent to cookies. Accept Learn more