A responsive header with your logo (left), links (center) and a CTA (right). Links and CTA are hidden on mobile and accessible with a burger menu.
Location: src/components/templates/Header.tsx
Quick Customization
This component is highly customizable:
- Navigation links - Update the
linksarray - Logo - Replace
/logo_w.pngwith your logo - CTA button - Customize or replace the button component
- Background - Change header background color
- Styling - Modify colors, spacing, and hover effects
Description
The header is the primary navigation element that appears on every page. It provides users with quick access to key sections (Features, Pricing, Docs) and the main call-to-action. The component automatically handles mobile navigation with a slide-in menu.
Usage
import Header from "@/components/templates/Header";
<Header />
Features
- Responsive layout - Desktop: logo left, links center, CTA right
- Mobile menu - Burger button with slide-in menu from right
- Auto-close - Mobile menu closes automatically on route change
- Hover effects - Navigation links have animated underline on hover
- Accessible - ARIA labels and keyboard navigation support
Layout
Desktop Layout
[Logo + App Name] | [Features] [Pricing] [Docs] [FAQ] | [Get Started]
Mobile Layout
[Logo + App Name] [☰ Burger Menu]
When burger is clicked:
- Fixed overlay menu slides in from right
- Contains all navigation links
- CTA button at bottom
- Click outside or on link to close
Customization
Navigation Links
Update the links array in the component:
const links = [
{ href: "/#features", label: "Features" },
{ href: "/#pricing", label: "Pricing" },
{ href: "/docs", label: "Docs" },
{ href: "/#faq", label: "FAQ" },
];
Link Types:
- Use
/#sectionfor anchor links on same page - Use
/pagefor full page navigation - Use
/docsfor documentation pages
Logo
The header uses /logo_w.png from the public folder. To change:
- Add your logo to
public/folder - Update the
Imagecomponentsrcprop:
<Image
src="/your-logo.png" // Update this
alt={`${config.appName} logo`}
className="w-10 h-10"
width={40}
height={40}
/>
CTA Button
By default uses ButtonSignin component. To customize:
- Replace
ButtonSigninwith your own component - Or modify
ButtonSigninstyling via props
// Current
const cta = <ButtonSignin extraStyle="btn-primary" />;
// Custom
const cta = (
<Link href="/auth" className="btn btn-primary">
Get Started
</Link>
);
Background Color
Change header background in the component:
<header className="bg-base-200 ..."> // Change bg-base-200 to your color
Code Example
import Header from "@/components/templates/Header";
export default function Page() {
return (
<>
<Header />
<main>
{/* Your page content */}
</main>
</>
);
}
Tips
- Keep brand name small - Unless you're Nike or Apple, visitors don't know who you are. Keep logo/brand small and let the value proposition speak.
- Always include Pricing link - No matter what you sell, people will look for pricing in the header. Make it easy to find.
- Mobile-first - Test mobile menu thoroughly. Many users will access your site on mobile.
- Anchor links - Use
/#sectionfor smooth scrolling to sections on the same page. - Sticky header - Add
sticky top-0 z-50classes if you want header to stick while scrolling.
Mobile Menu Behavior
- Opens on burger button click
- Slides in from right with overlay
- Closes on:
- Clicking outside menu
- Clicking any navigation link
- Route change (automatic)
- Close button click
Examples
// Basic usage (includes all features)
<Header />
// Already configured with:
// - Logo from /logo_w.png
// - Navigation links
// - ButtonSignin CTA
// - Mobile menu
Learn More
- ButtonSignin Component - CTA button used in header
- Logo Component - Logo component details
- Mobile Menu Tutorial