DEV Community

Discussion on: Create a Responsive Navbar using React and Tailwind

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan

Visually, this looks great! Just a word of advice, you'll want to use anchors for the tabs rather than just list items. You can nest an a inside each list item and style it accordingly. This allows for keyboard navigation, as well as use of attributes like aria-current="page" to designate the active page. It also means you no longer need an onClick handler and can just use an href. (Note that most client-side routing libraries will also expose a custom Link component, so you could use one of those instead.)

Collapse
 
franciscomendes10866 profile image
Francisco Mendes

Yes I would do just that, but unfortunately I didn't have the react-router installed in my project. 🤓 But anyway thanks for your comment, it's informative and complements the article! 😊