Link Tabs
I have these different Label's , when I come from other page to this page how can I make other labels active based on what the user clicked on the previous page?
9 Replies
Depends on how your is rendered what are u using...
Views?
React?
Next.js?
Vanilla?
You would do that with a class but how to achieve it
Vanilla
That means your hard coding your navbar into every page
You would just use a class
yes
you can read the url with window.location.href and based on that add an active class to the matching label
ok let me try
[aria-current="page"] {style me daddy}
Don't use a class use aria-current attribute & selector and double down on awesomeBen Myers
Style with Stateful, Semantic Selectors
See how building with accessible semantics from the get-go can give you expressive, meaningful style hooks for free.
{style me daddy}