Join the Webstudio community

Updated 3 weeks ago

Navbar link highlighting for active page not working – using state

At a glance

A community member is trying to create a navbar in Webstudio where the link to the current page is highlighted. They are using state to handle this, but it's not working as expected. Another community member suggests that the issue may be due to the preview mode, as the highlighting works fine when the site is published. The community members have created an issue on the Webstudio repository to address this problem.

Useful resources
Hi everyone,

I'm trying to create a navbar in Webstudio where the link to the current page is highlighted. I'm using state to handle this, but for some reason it's not working as expected. I'm not sure what I'm doing wrong.

Any help would be appreciated!

https://

Thanks in advance!
Okay update, I figured out it works fine, but only if you publish the site and check it there. In the preview if i select the page it doesn't work properly.
View full solution
O
y
4 comments
I don' see you using Current Page state
I'm using it on the Navbar Link
Okay update, I figured out it works fine, but only if you publish the site and check it there. In the preview if i select the page it doesn't work properly.
ah that's probably becacuse on preview the routing doesn't go through the normal pipeline, probably needs fixing, created an issue

https://github.com/webstudio-is/webstudio/issues/5207
Add a reply
Sign up and join the conversation on Discord