Overview
The Header component provides the main navigation interface for the portfolio site. It features a sticky positioning, responsive mobile menu, smooth scroll navigation, and language toggle functionality. Location:src/components/Header/Header.jsx
Key Features
Smooth Scroll Navigation
Implements smooth scrolling behavior with hash-based routing for seamless section navigation
Responsive Design
Collapsible hamburger menu for mobile devices with animated transitions
Language Toggle
Built-in internationalization support with English/Spanish language switching
Sticky Positioning
Remains fixed at the top of the viewport with backdrop blur effect
Component Structure
State Management
The component uses React hooks for state management:isMenuOpen: Controls mobile menu visibilityt: Translation function from react-i18nexti18n: i18n instance for language switching
Navigation Links
Navigation items are defined as an array with translation keys:Functionality
Smooth Scroll Handler
ThehandleNavClick function provides smooth scrolling with hash updates:
The menu automatically closes after navigation on mobile devices for better UX.
Language Toggle
Language switching between English and Spanish:Styling
Header Container
sticky top-0 z-50: Fixed positioning at top with high z-indexbg-slate-950/80: Semi-transparent dark backgroundbackdrop-blur: Glassmorphism effect for content behind header
Logo Section
Responsive Menu Toggle
The mobile menu uses conditional classes for animation:Translation Keys
View all translation keys used
View all translation keys used
| Key | English | Spanish |
|---|---|---|
header.home | Home | Inicio |
header.about | About | Sobre mí |
header.technology | Skills | Skills |
header.works | Experience | Experiencia |
header.projects | Projects | Proyectos |
header.contact | Contact | Contacto |
header.openMenu | Open menu | Abrir menú |
header.closeMenu | Close menu | Cerrar menú |
changeLanguage | ES / EN | EN / ES |
Accessibility Features
- ARIA labels on menu toggle button for screen readers
- Semantic HTML with proper
<header>and<nav>tags - Keyboard navigation support for all interactive elements
- Focus states with hover effects on all links and buttons
Responsive Breakpoints
- Mobile (< 640px)
- Desktop (≥ 640px)
- Hamburger menu icon visible
- Language toggle moves inside collapsible menu
- Name text hidden, only logo shown
- Vertical menu layout
Integration Example
The Header is typically rendered at the top of the main application:Dependencies
- React: useState hook for state management
- react-i18next: Translation and language switching
- Bootstrap Icons: Icon library for menu and visual elements
- Tailwind CSS: Utility-first styling
