Skip to content

fix: add active state styling to navbar links#922

Open
sh1vam31 wants to merge 3 commits intoasyncapi:masterfrom
sh1vam31:fix/896-navbar-active-styling
Open

fix: add active state styling to navbar links#922
sh1vam31 wants to merge 3 commits intoasyncapi:masterfrom
sh1vam31:fix/896-navbar-active-styling

Conversation

@sh1vam31
Copy link
Copy Markdown
Contributor

@sh1vam31 sh1vam31 commented Feb 3, 2026

Description

This PR adds active state styling to navbar links to improve navigation clarity and user experience.

Problem

The navbar previously did not visually indicate which page or section the user is currently viewing. All navigation links appeared identical in both active and inactive states, making navigation unclear—especially for first-time users.

Fixes #896

Changes

Desktop Navbar (navbar.tsx)

  • Added useRouter hook from Next.js to detect current route
  • Implemented isLinkActive() helper function to determine active state for:
    • Hash-based links (e.g., /#about, /#speakers)
    • Route-based links (e.g., /editions, /venue/California)
  • Applied visual styling to active links:
    • Bold font weight for active text
    • Visible underline that stays permanent (not just on hover)
  • Parent dropdown items (e.g., "Venue") show active state when on child routes
  • Submenu items display bold + underline when active

Mobile Navbar (navDrop.tsx)

  • Implemented same route detection logic using useRouter
  • Applied consistent active styling:
    • Bold text for active links
    • Left border (border-l-4 border-white) for visual indicator on mobile

Visual Changes

Before: All links look the same, no indication of current page
After: Active links display bold text with underline, providing clear visual feedback

Related Issues

Closes #896

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 3, 2026

Deploy Preview for peaceful-ramanujan-288045 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit dad2f73
🔍 Latest deploy log https://app.netlify.com/projects/peaceful-ramanujan-288045/deploys/69a8f9222036cc000823834a
😎 Deploy Preview https://deploy-preview-922--peaceful-ramanujan-288045.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@TenzDelek TenzDelek self-requested a review as a code owner March 5, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Add active state styling to navbar links

3 participants