NavDualLine Navigation
Twee-rijen nav: utility links bovenaan, hoofd navigatie onderaan.
src/components/nav/NavDualLine.astro
---
/**
* NavDualLine
* Twee-rijen navigatie: bovenste rij utility links, onderste rij hoofdnavigatie.
*/
interface Props {
logo: string;
topLinks?: { label: string; href: string }[];
mainLinks: { label: string; href: string; active?: boolean }[];
cta?: { label: string; href: string };
phone?: string;
}
const { logo, topLinks = [], mainLinks, cta, phone } = Astro.props;
---
<div class="ndl">
<div class="ndl-top">
<div class="ndl-top-inner">
<div class="ndl-top-links">
{topLinks.map(l => <a href={l.href} class="ndl-top-link">{l.label}</a>)}
</div>
<div class="ndl-top-right">
{phone && <span class="ndl-phone">📞 {phone}</span>}
{cta && <a href={cta.href} class="ndl-cta">{cta.label}</a>}
</div>
</div>
</div>
<header class="ndl-main">
<nav class="ndl-main-inner">
<a href="/" class="ndl-logo">{logo}</a>
<ul class="ndl-links">
{mainLinks.map(l => (
<li><a href={l.href} class={`ndl-link${l.active ? ' ndl-link--active' : ''}`}>{l.label}</a></li>
))}
</ul>
</nav>
</header>
</div>
<style>
.ndl-top { background: #1e293b; }
.ndl-top-inner { max-width: 1280px; margin: 0 auto; padding: 0.4rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.ndl-top-link { font-size: 0.75rem; color: rgba(255,255,255,0.65); text-decoration: none; margin-right: 1rem; transition: color 0.15s; }
.ndl-top-link:hover { color: #fff; }
.ndl-top-right { display: flex; align-items: center; gap: 1rem; }
.ndl-phone { font-size: 0.75rem; color: rgba(255,255,255,0.65); }
.ndl-cta { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.75rem; background: var(--color-accent,#6366f1); color: #fff; border-radius: 0.25rem; text-decoration: none; }
.ndl-main { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; }
.ndl-main-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; height: 60px; gap: 2rem; }
.ndl-logo { font-weight: 800; font-size: 1.125rem; color: #0a0a0a; text-decoration: none; letter-spacing: -0.02em; }
.ndl-links { list-style: none; padding: 0; margin: 0; display: flex; flex: 1; gap: 0; }
.ndl-link { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; text-decoration: none; padding: 0.375rem 0.875rem; border-radius: 0.375rem; transition: all 0.15s; }
.ndl-link:hover, .ndl-link--active { color: var(--color-accent,#6366f1); background: rgba(99,102,241,0.07); }
@media (max-width: 768px) { .ndl-top { display: none; } .ndl-links { display: none; } }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
logo * | string | — | Merknaam |
mainLinks * | { label: string; href: string; active?: boolean }[] | — | Hoofd navigatielinks |
topLinks | { label: string; href: string }[] | — | Utility links in topbalk |
cta | { label: string; href: string } | — | CTA knop |
phone | string | — | Telefoonnummer in topbalk |
* = verplicht