Astro components
Header
The main site header.
The Header component serves as the primary navigation bar for the application. It features a floating, blurred-glass aesthetic with a responsive design that adapts for mobile and desktop views.
Overview
This component provides a fixed-position navigation experience. It includes the application branding, dynamic navigation links, theme switching capabilities, and user authentication triggers (Log in / Sign up).
Key Features
- Fixed Navigation: Sticks to the top of the viewport with a slight offset.
- Glassmorphism: Uses
backdrop-blurand linear gradients for a modern UI depth. - Responsive: Switches between a standard desktop navbar and a mobile-specific drawer/menu.
- Theme Support: Integrated
ThemeTogglefor switching between light and dark modes.
Usage
To use this component, import it into your Astro layout or page:
---
import Header from '@/components/Header.astro';
---
<Header />Component Structure
The component is divided into three main functional zones:
- Branding (Left): Contains the
AppLogoand a screen-reader-only title. - Primary Navigation (Center): Desktop-only links rendered via the React/Solid/Vue
Navbarcomponent. - Utilities & Auth (Right): Includes the
ThemeToggle, Auth buttons, and theNavMobiletoggle.
| Component | Source | Responsibility |
|---|---|---|
AppLogo | @/components/core/app-logo | Renders the SVG/Icon branding. |
Navbar | @/components/core/navbar | Handles desktop navigation links (Client-side hydrated). |
ThemeToggle | @/components/ThemeToggle.astro | An Astro component managing dark/light mode logic. |
NavMobile | @/components/core/nav-mobile | Mobile-specific navigation menu (Client-side hydrated). |