Header
TheHeader.astro component provides the main navigation bar for Proyecto Renacer. It features a sticky header with the site logo, navigation menu, and a prominent call-to-action button.
Location
src/components/Header.astro
Props
This component does not accept props. Navigation items are defined internally.Features
Sticky Navigation
The header stays fixed at the top of the viewport with:position: sticky- Semi-transparent backdrop with blur effect
- Border bottom for visual separation
- z-index of 50 for proper layering
Logo
Branded logo with:- Material Symbol
home_pinicon - “RENACER” text in uppercase
- Primary color scheme
- Links to homepage
Navigation Menu
Integrates theNavigation.astro component with predefined menu items:
Call-to-Action Button
Prominent “Como ser Socio” button with:- Primary background color
- Hover state with reduced opacity
- Rounded corners and shadow
- Links to
/como-ser-socio
Usage
Basic Implementation
In Every Page
The Header should be included at the top of every page’s content area, right after the opening<Layout> tag:
Implementation Details
HTML Structure
Styling Features
Responsive Padding:- Mobile:
px-4 - Tablet:
md:px-20 - Desktop:
lg:px-40
Navigation Component
The Header uses theNavigation.astro component internally, which:
- Accepts a
listItemsarray of{ tag, link }objects - Renders navigation items using
NavItem.astro - Hidden on mobile (
hidden md:flex) - Displays horizontally with spacing
Navigation Structure
Customization
Modifying Navigation Items
To add or remove navigation items, edit thelistItems array in Header.astro:
Changing CTA Button
Modify the button link or text:Accessibility
- Semantic
<header>element - Proper
<nav>structure - Clear navigation hierarchy
- Sufficient color contrast
- Focus states on interactive elements
Performance
- Minimal JavaScript (component is static)
- CSS-only hover effects
- Efficient backdrop-blur with GPU acceleration
- Optimized z-index layering
Related Components
- Navigation - Navigation menu logic
- NavItem - Individual navigation links
- Layout - Main layout wrapper