src/components/nav/NavSplit.astro
---
/**
* NavSplit
* Logo midden, links links, acties rechts. Clean 3-kolom layout.
*/
interface Props {
logo: string;
leftLinks: { label: string; href: string; active?: boolean }[];
rightLinks?: { label: string; href: string }[];
cta?: { label: string; href: string };
}
const { logo, leftLinks, rightLinks = [], cta } = Astro.props;
---
<header class="ns">
<nav class="ns-inner">
<ul class="ns-col ns-col--left">
{leftLinks.map(l => (
<li><a href={l.href} class={`ns-link${l.active ? ' ns-link--active' : ''}`}>{l.label}</a></li>
))}
</ul>
<a href="/" class="ns-logo">{logo}</a>
<div class="ns-col ns-col--right">
{rightLinks.map(l => (
<a href={l.href} class="ns-link">{l.label}</a>
))}
{cta && <a href={cta.href} class="ns-cta">{cta.label}</a>}
</div>
</nav>
</header>
<style>
.ns { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; }
.ns-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; }
.ns-col { display: flex; align-items: center; gap: 0; list-style: none; padding: 0; margin: 0; }
.ns-col--right { justify-content: flex-end; gap: 0.5rem; }
.ns-logo { font-weight: 800; font-size: 1.125rem; color: #0a0a0a; text-decoration: none; letter-spacing: -0.02em; }
.ns-link { font-size: 0.875rem; font-weight: 500; color: #374151; text-decoration: none; padding: 0.375rem 0.75rem; border-radius: 0.375rem; transition: color 0.15s, background 0.15s; }
.ns-link:hover, .ns-link--active { color: var(--color-accent,#6366f1); background: rgba(99,102,241,0.07); }
.ns-cta { font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1.25rem; background: var(--color-accent,#6366f1); color: #fff; border-radius: 0.5rem; text-decoration: none; transition: opacity 0.2s; }
.ns-cta:hover { opacity: 0.88; }
@media (max-width: 768px) { .ns-col { display: none; } .ns-inner { display: flex; justify-content: space-between; } }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
logo * | string | — | Merknaam (gecentreerd) |
leftLinks * | { label: string; href: string; active?: boolean }[] | — | Links linkerkant |
rightLinks | { label: string; href: string }[] | — | Links rechterkant |
cta | { label: string; href: string } | — | CTA knop |
* = verplicht