src/components/nav/NavDark.astro
---
/**
* NavDark
* Donkere navigatiebalk met lichtgekleurde links en accent CTA.
*/
interface Props {
logo: string;
links: { label: string; href: string; active?: boolean }[];
cta?: { label: string; href: string };
accentColor?: string;
}
const { logo, links, cta, accentColor = '#6366f1' } = Astro.props;
---
<header class="nd">
<nav class="nd-inner">
<a href="/" class="nd-logo">{logo}</a>
<ul class="nd-links">
{links.map(l => (
<li><a href={l.href} class={`nd-link${l.active ? ' nd-link--active' : ''}`}>{l.label}</a></li>
))}
</ul>
<div class="nd-actions">
{cta && <a href={cta.href} class="nd-cta" style={`background:${accentColor}`}>{cta.label}</a>}
</div>
<button class="nd-burger" aria-label="Menu">
<span></span><span></span><span></span>
</button>
</nav>
</header>
<style>
.nd { background: #0a0a0a; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nd-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; height: 64px; gap: 2rem; }
.nd-logo { color: #fff; font-weight: 800; font-size: 1.125rem; text-decoration: none; letter-spacing: -0.02em; margin-right: 1rem; }
.nd-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 0; flex: 1; }
.nd-link { display: block; font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.65); text-decoration: none; padding: 0.375rem 0.875rem; border-radius: 0.375rem; transition: color 0.15s, background 0.15s; }
.nd-link:hover, .nd-link--active { color: #fff; background: rgba(255,255,255,0.08); }
.nd-actions { margin-left: auto; }
.nd-cta { font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1.25rem; color: #fff; border-radius: 0.5rem; text-decoration: none; transition: opacity 0.2s; }
.nd-cta:hover { opacity: 0.85; }
.nd-burger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.nd-burger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
@media (max-width: 768px) { .nd-links { display: none; } .nd-burger { display: flex; } }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
logo * | string | — | Merknaam |
links * | { label: string; href: string; active?: boolean }[] | — | Navigatielinks |
cta | { label: string; href: string } | — | CTA knop |
* = verplicht