Skip to content

feat: added active status indicator to navbar links#1256

Open
AnanyaSingh656 wants to merge 1 commit into
CodeGraphContext:mainfrom
AnanyaSingh656:feature/navbar-active-indicator
Open

feat: added active status indicator to navbar links#1256
AnanyaSingh656 wants to merge 1 commit into
CodeGraphContext:mainfrom
AnanyaSingh656:feature/navbar-active-indicator

Conversation

@AnanyaSingh656

Copy link
Copy Markdown

Description

Implemented a scroll-spy active state indicator for the landing page navigation. The navbar now dynamically detects the current section in view using the IntersectionObserver API and highlights the corresponding link with a purple underline (bg-purple-500).

Technical Changes

  • Scroll Tracking: Integrated IntersectionObserver in Navbar.tsx to monitor section visibility.
  • Dynamic Styling: Added logic to conditionally render a <span> dash below active links.
  • UX Optimization: Added setActiveSection to onClick for immediate visual feedback upon clicking nav elements.
  • Layout Safety: Switched to h-full on list items for pixel-perfect alignment with the navbar border.

🔗 Related Issue

📸 Visual Comparison

Before :
image

After:
image


Testing Performed

  • Verified locally via npm run dev in the /website directory.
  • Tested automatic scroll-spy by scrolling through all landing page sections.
  • Tested manual click-activation for all navbar anchors.
  • Verified responsive behavior on mobile and desktop viewports.

GSSoC'26 Checklist


Hi @Shashankss1205. Since this is a GSSoC '26 contribution, could you please review and apply the applicable evaluation labels when merging?
Thanks:)
-Ananya Singh

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

@AnanyaSingh656 is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

@AnanyaSingh656 AnanyaSingh656 changed the title feat: added active status indicator of purple color to navbar links feat: added active status indicator to navbar links Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog tasks

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add Active State Indicator to Navbar Links

1 participant