SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
810 stars 52 forks source link

[BUG]: Button Component Missing Active State #173

Closed shrix1 closed 3 months ago

shrix1 commented 4 months ago

Description 📝

There is no active state on button component in sidebar : https://syntaxui.com/components/button/neubrutalism-button

Screenshot 2024-05-08 at 2 24 10 PM

How to Fix:

Active state should look something like this:

Screenshot 2024-05-08 at 2 32 50 PM

Link 🔗

https://syntaxui.com/components/button/neubrutalism-button

The-CodeINN commented 4 months ago

I think the pathname changes when you in a child page. What can be done is add the active state to the child pages

epoll31 commented 4 months ago

This might be the intended functionality.

But, if we wanted to change it to include the subitems too, we can change Navigation.tsx:

let isActiveGroup = group.links.findIndex((link) => link.href === pathname) !== -1

This is how the current tab is selected, we can use includes instead of === or something like that.