Zoeken...  ⌘K GitHub

NavAccent Navigation

Nav met gekleurde accentstripe linksboven. Merk-expressief.

/nav-accent
src/components/nav/NavAccent.astro
---
/**
 * NavAccent
 * Navigatie met gekleurde accentbalk linksboven het logo. Merk-expressief.
 */
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="nac" style={`--ac:${accentColor}`}>
  <div class="nac-stripe"></div>
  <nav class="nac-inner">
    <a href="/" class="nac-logo">{logo}</a>
    <ul class="nac-links">
      {links.map(l => (
        <li><a href={l.href} class={`nac-link${l.active ? ' nac-link--active' : ''}`}>{l.label}</a></li>
      ))}
    </ul>
    {cta && <a href={cta.href} class="nac-cta">{cta.label}</a>}
  </nav>
</header>
<style>
  .nac { background: #fff; box-shadow: 0 1px 0 #e5e7eb; position: sticky; top: 0; z-index: 100; }
  .nac-stripe { height: 3px; background: var(--ac); }
  .nac-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; height: 60px; gap: 2rem; }
  .nac-logo { font-weight: 800; font-size: 1.0625rem; color: #0a0a0a; text-decoration: none; letter-spacing: -0.02em; }
  .nac-links { list-style: none; padding: 0; margin: 0; display: flex; flex: 1; gap: 0; }
  .nac-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; }
  .nac-link:hover, .nac-link--active { color: var(--ac); background: color-mix(in srgb, var(--ac) 8%, transparent); }
  .nac-cta { margin-left: auto; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1.25rem; background: var(--ac); color: #fff; border-radius: 0.5rem; text-decoration: none; transition: opacity 0.2s; white-space: nowrap; }
  .nac-cta:hover { opacity: 0.88; }
  @media (max-width: 768px) { .nac-links { display: none; } }
</style>

Props

Prop Type Default Beschrijving
logo * string Merknaam
links * { label: string; href: string; active?: boolean }[] Navigatielinks
cta { label: string; href: string } CTA knop
accentColor string '#6366f1' Kleur van de bovenste accent stripe

* = verplicht