Skip to main content
The Navbar component provides a fixed, responsive navigation bar with glassmorphism effects, dropdown menus, and mobile support.

Features

  • Fixed positioning with scroll-based background changes
  • Centered desktop menu with glassmorphism pill design
  • Dynamic dropdown menu for solutions/services
  • Mobile hamburger menu with slide-down panel
  • Active route highlighting
  • Auto-close on route change

Usage

Component Props

The Navbar component does not accept any props. It’s a self-contained component that reads navigation data from siteContent.navigation.

State Management

The component manages several internal state variables:
boolean
default:"false"
Controls the mobile menu visibility
boolean
default:"false"
Tracks whether the user has scrolled past 20px, triggering background changes
boolean
default:"false"
Controls the mobile solutions dropdown visibility

Data Structure

The Navbar reads navigation links from siteContent.navigation, which should be an array of NavLink objects:

Key Features

Scroll Effect

The navbar changes appearance when scrolled:
When scrolled is true:
  • Applies glass-panel class with blur effect
  • Adds bottom border
  • Reduces vertical padding

Desktop Menu Layout

The desktop menu is absolutely centered using:

Solutions Dropdown

A special dropdown menu is injected after the “Nosotros” link:
  • Hover-triggered on desktop
  • Click-triggered on mobile
  • Displays solution items from siteContent.solutions.items
  • Links to /soluciones/{slug} paths
Links use React Router’s NavLink with active state detection:

Mobile Menu

The mobile menu:
  • Appears below md breakpoint
  • Slides down with smooth height transition
  • Auto-closes on route change via useEffect
  • Includes expandable solutions submenu

Styling Classes

Key CSS classes used:
  • glass-panel: Semi-transparent background with backdrop blur
  • glass-button: Button with glass effect
  • brand-green: Primary green accent color
  • border-white/5: Subtle white border with 5% opacity

Integration with Site Content

The component integrates with the centralized siteContent data:
  • siteContent.navigation: Main navigation links
  • siteContent.header.logo: Logo image
  • siteContent.header.cta: Call-to-action button config
  • siteContent.solutions.items: Dropdown menu items

Example Navigation Data

Component Location

components/Navbar.tsx:10