Questions and discussions about using the Shopify CLI and Shopify-built libraries.
We're in the process of implementing UI-Nav-Menu and wondering if there's any way to set the active link? Something like the following:
<ui-nav-menu>
<a href="/" rel="home">Home</a>
<a href="/templates" active="true">Templates</a>
<a href="/settings">Settings</a>
</ui-nav-menu>
The core issue is that users navigate to pages within our app without interacting with the Ui Nav Menu, and this leads to an inconsistency between the active link shown in the UI Nav Menu and the page currently displayed to the user.
Any advice or insights would be greatly appreciated!
Any update?
You can add route parameter to the URL, it highlights the menu which matches with the route.
For example, if url is -
<YOUR SHOPIFY APP URL>/templates
then, the templates menu will be highlighted.