Navbar
The main navigation bar with logo, navigation links, dropdown menu, and theme switcher.Props
The Navbar component doesn’t accept props but reads from:Astro.url.pathnamefor active link highlightingsiteConfigfor logo and site information
Usage
Features
Desktop Navigation
Desktop Navigation
Mobile Navigation
Mobile Navigation
Navigation Structure
Active Link Logic
The component uses a helper function to determine active links:Customization
To modify navigation links, edit thenavLinks and moreLinks arrays in the component file:
~/workspace/source/src/components/navs/Navbar.astro:10
MobileNav
A slide-out drawer navigation for mobile devices with animations and theme switching.Props
Array of navigation link objects to display in the mobile menu
Usage
Features
Drawer Animation
Drawer Animation
- Slides in from right with backdrop blur
- Staggered animation for navigation items
- Smooth transitions with configurable delays
- Transform and opacity animations
- Closes with backdrop click or Escape key
Menu Structure
Menu Structure
Interaction Features
The MobileNav component includes:- Open trigger: Hamburger button in Navbar
- Close methods: Close button, backdrop click, Escape key, link click
- Body scroll lock: Prevents background scrolling when open
- Accessibility: ARIA attributes, inert state when closed
- Astro integration: Reinitializes after page transitions
Styling
Active links receive special styling:Animation Delays
Each navigation item has a staggered animation:Footer
Site footer with about section, social links, newsletter signup, and copyright information.Usage
Features
Left Section
Left Section
- Site tagline from
siteConfig - Social media icons with hover effects
- Grid layout: icon grid adapts to number of socials
- Border and background color transitions
Right Section
Right Section
- NewsletterForm component
- Newsletter signup functionality
- Form ID:
footer-newsletter-form
Bottom Bar
Bottom Bar
- Copyright notice with current year
- “Built with ❤️ using Astro” message
- Designer credit with link
- Responsive flex layout
Content Sources
The footer fetches data from:Social Icons
Social icons are rendered dynamically based on theicon field:
- Stroke icons: Email icon uses stroke rendering
- Fill icons: All other social icons use filled paths
Newsletter Integration
The footer includes a newsletter form with IDfooter-newsletter-form. The form is handled by the NewsletterForm component’s client-side script.
SideNav
Contextual navigation for the About section with smooth scrolling to page sections.Usage
Features
Navigation Items
Navigation Items
Active Section Highlighting
Active Section Highlighting
The component automatically highlights the active section based on scroll position:
- Checks if section is in viewport (within 200px of top)
- Adds border, background, and text color to active item
- Updates dynamically on scroll
- Initializes on page load
Interactive Features
Click Behavior:Styling
The component features:- Gradient line accent
- Animated pulse indicator
- Hover state transitions
- Border-left highlight for active item
- Responsive spacing and sizing
Layout Context
Best used in a sticky container on desktop:~/workspace/source/src/components/home/About.astro:35
Navigation Best Practices
Responsive Design
Responsive Design
- Use Navbar for desktop (md and up)
- Use MobileNav for mobile (below md)
- Ensure both have same links for consistency
- Test touch targets on mobile (minimum 44x44px)
Active Link States
Active Link States
- Implement consistent active link styling
- Use route-based highlighting
- Consider hash links vs full routes
- Update active state on navigation
Accessibility
Accessibility
- Add proper ARIA labels
- Support keyboard navigation
- Implement focus states
- Use semantic HTML elements
- Add skip-to-content links
Performance
Performance
- Use Astro’s View Transitions for smooth navigation
- Lazy load mobile menu content
- Optimize backdrop blur effects
- Minimize JavaScript for menu interactions