Zoeken...  ⌘K GitHub

NavStacked Navigation

Logo boven navigatielinks. Vertikal gestapeld voor specifieke layouts.

/nav-stacked
src/components/nav/NavStacked.astro
---
/**
 * NavStacked
 * Logo boven navigatielinks. Compacte verticale opmaak voor specifieke layouts.
 */
interface Props {
  logo: string;
  tagline?: string;
  links: { label: string; href: string; active?: boolean }[];
  cta?: { label: string; href: string };
}
const { logo, tagline, links, cta } = Astro.props;
---
<header class="nst">
  <div class="nst-brand">
    <a href="/" class="nst-logo">{logo}</a>
    {tagline && <span class="nst-tagline">{tagline}</span>}
  </div>
  <nav class="nst-nav">
    <ul class="nst-links">
      {links.map(l => (
        <li><a href={l.href} class={`nst-link${l.active ? ' nst-link--active' : ''}`}>{l.label}</a></li>
      ))}
    </ul>
    {cta && <a href={cta.href} class="nst-cta">{cta.label}</a>}
  </nav>
</header>
<style>
  .nst { background: #fff; border-bottom: 2px solid #0a0a0a; }
  .nst-brand { max-width: 1280px; margin: 0 auto; padding: 1.25rem 2rem 0.5rem; display: flex; align-items: baseline; gap: 1rem; }
  .nst-logo { font-weight: 900; font-size: 1.75rem; color: #0a0a0a; text-decoration: none; letter-spacing: -0.04em; line-height: 1; }
  .nst-tagline { font-size: 0.75rem; color: #6b7280; letter-spacing: 0.06em; text-transform: uppercase; }
  .nst-nav { border-top: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; background: #fff; }
  .nst-nav > * { max-width: 1280px; margin: 0 auto; }
  .nst-links { list-style: none; padding: 0 2rem; margin: 0; display: flex; gap: 0; }
  .nst-link { display: block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; text-decoration: none; padding: 0.75rem 0.875rem; border-bottom: 2px solid transparent; transition: all 0.15s; }
  .nst-link:hover, .nst-link--active { color: #0a0a0a; border-bottom-color: #0a0a0a; }
  .nst-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; }
  .nst-cta { font-size: 0.8125rem; font-weight: 700; padding: 0.5rem 1.125rem; background: #0a0a0a; color: #fff; border-radius: 0.375rem; text-decoration: none; transition: opacity 0.2s; white-space: nowrap; }
  .nst-cta:hover { opacity: 0.8; }
</style>

Props

Prop Type Default Beschrijving
logo * string Merknaam
links * { label: string; href: string; active?: boolean }[] Navigatielinks
tagline string Tagline naast logo
cta { label: string; href: string } CTA knop

* = verplicht