Roosevelt Docs

Navigation

Navigation component patronen voor header en sidebar

Navigation

Beta

Dit component is in beta — de API kan nog wijzigen.

Header Navigation

<header class="border-b border-outline bg-surface-primary">
  <nav class="mx-auto flex max-w-7xl items-center justify-between px-6 py-4">
    <a href="/" class="font-logo text-title-l text-brand">Roosevelt</a>
    <ul class="flex items-center gap-6">
      <li>
        <a href="/services" class="text-body text-label-secondary
                                    transition-colors duration-150
                                    hover:text-label-primary">
          Services
        </a>
      </li>
      <li>
        <a href="/about" class="text-body text-label-secondary
                                 transition-colors duration-150
                                 hover:text-label-primary">
          About
        </a>
      </li>
      <li>
        <a href="/contact" class="inline-flex items-center rounded-s
                                   bg-brand px-4 py-2 text-body font-medium
                                   text-label-on-color transition-colors
                                   duration-150 hover:opacity-90">
          Contact
        </a>
      </li>
    </ul>
  </nav>
</header>

Active State

<a href="/services" class="text-body font-medium text-label-primary"
   aria-current="page">
  Services
</a>

Token Mapping

PropertyToken
Border bottom--color-outline-default
Background--color-bg-primary
Logo font--font-logo + --color-brand
Link default--color-label-secondary
Link hover--color-label-primary
Link active--color-label-primary + font-medium
CTA button--color-brand + --color-label-on-color
Transition--transition-fast

Accessibility

  • Gebruik <nav> element met aria-label="Main navigation"
  • Active page: aria-current="page"
  • Mobile: hamburger menu met aria-expanded en aria-controls
  • Skip link: <a href="#main" class="sr-only focus:not-sr-only">Skip to content</a>

On this page