Forum Discussion

harishpatil's avatar
harishpatil
Brass Contributor
Aug 12, 2025

How to highlight left navigation when we select the list view

Hi All,

 

How to highlight left navigation when we select the list view?

 

We have created list and the same list view URL we have added in left navigation links. When we select the view from the list of views then same view in left navigation should be highlighted. Please find the below screen shot.

Thanks,

Harish Patil

10 Replies

  • harishpatil's avatar
    harishpatil
    Brass Contributor

    Hi Pankaj and All,

     

    Ok. We will try with SPFX this also. How to close or mark as answers

     

    Thanks,

    Harish Patil

  • PankajBadoni's avatar
    PankajBadoni
    Iron Contributor

    Yes, you can achieve this using an SPFx Application Customizer.

    Steps to Implement:

    1. Create an SPFx Application Customizer
      This will allow you to inject custom navigation into your SharePoint pages.
    2. Track the Current URL
      Use window.location.href or window.location.search to detect which view is currently active.
    3. Define Navigation Items with View IDs
      Create a list of navigation links, each associated with a specific view ID.
    4. Apply Styling to Highlight the Active Item
      Use conditional logic to apply an active class to the navigation item that matches the current view.
    5. Store Navigation Items in a SharePoint List
      This allows for dynamic updates and easier management of navigation links without redeploying code.
  • harishpatil's avatar
    harishpatil
    Brass Contributor

    Hi Pankaj and All,

     

    But this is working on SharePoint 2013. This means it is working on SharePoint 2013 but not SharePoint Online.

     

    Is here any way achieve this SPFX.

     

    Thanks,

    Harish Patil

  • PankajBadoni's avatar
    PankajBadoni
    Iron Contributor

    It doesn't seem possible out-of-the-box (OOTB) because SharePoint navigation highlights the menu item that matches the URL in the browser's address bar. When you switch views within a list, the URL only updates the view ID (e.g., ?viewid=xyz) without changing the base path. As a result, the navigation doesn't recognize it as a different page and doesn't update the highlight accordingly.

    • harishpatil's avatar
      harishpatil
      Brass Contributor

      Hi Pankaj and All,

       

      But this is working on SharePoint 2013. This means it is working on SharePoint 2013 but not SharePoint Online.

       

      Is here any way achieve this SPFX.

       

      Thanks,

      Harish Patil

      • PankajBadoni's avatar
        PankajBadoni
        Iron Contributor

        Hi Harish,

         

        Yes, you can achieve this using an SPFx Application Customizer.

        Steps to Implement:

        1. Create an SPFx Application Customizer
          This will allow you to inject custom navigation into your SharePoint pages.
        2. Track the Current URL
          Use window.location.href or window.location.search to detect which view is currently active.
        3. Define Navigation Items with View IDs
          Create a list of navigation links, each associated with a specific view ID.
        4. Apply Styling to Highlight the Active Item
          Use conditional logic to apply an active class to the navigation item that matches the current view.
        5. Store Navigation Items in a SharePoint List
          This allows for dynamic updates and easier management of navigation links without redeploying code.
    • harishpatil's avatar
      harishpatil
      Brass Contributor

      Hi Dave and All,

       

      But this is working on SharePoint 2013. This means it is working on SharePoint 2013 but not SharePoint Online.

       

      Is here any way achieve this SPFX.

       

      Thanks,

      Harish Patil

  • PankajBadoni's avatar
    PankajBadoni
    Iron Contributor

    It doesn't seem possible out-of-the-box (OOTB) because SharePoint navigation highlights the menu item that matches the URL in the browser's address bar. When you switch views within a list, the URL only updates the view ID (e.g., ?viewid=xyz) without changing the base path. As a result, the navigation doesn't recognize it as a different page and doesn't update the highlight accordingly.

    You can consider using an SPFx extension to detect the active view and dynamically apply CSS for navigation highlighting based on the current view.

     

    • harishpatil's avatar
      harishpatil
      Brass Contributor

      Hi Pankaj and All,

       

      But this is working on SharePoint 2013. This means it is working on SharePoint 2013 but not SharePoint Online.

       

      Is here any way achieve this SPFX.

       

      Thanks,

      Harish Patil

Resources