Forum Discussion
harishpatil
Aug 12, 2025Brass Contributor
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...
PankajBadoni
Aug 13, 2025Iron 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.
- harishpatilAug 18, 2025Brass 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
- PankajBadoniAug 18, 2025Iron Contributor
Hi Harish,
Yes, you can achieve this using an SPFx Application Customizer.
Steps to Implement:
- Create an SPFx Application Customizer
This will allow you to inject custom navigation into your SharePoint pages. - Track the Current URL
Use window.location.href or window.location.search to detect which view is currently active. - Define Navigation Items with View IDs
Create a list of navigation links, each associated with a specific view ID. - Apply Styling to Highlight the Active Item
Use conditional logic to apply an active class to the navigation item that matches the current view. - Store Navigation Items in a SharePoint List
This allows for dynamic updates and easier management of navigation links without redeploying code.
- Create an SPFx Application Customizer