Navlink Stay Active When URL Partially Match

I mostly prefer to add the class toggle myself using dmx-class:active="browser1.pathname.startsWith('/order')". It requires the browser component on the page but is very flexible to use and works on all kind of navigation menus, not only bootstrap.

The dmxBootstrap5Navigation was to automate the toggling for you so that it is not needed to add your own logic. This works fine in most cases but will not cover the needs for everyone.

2 Likes