Top-nav

Navigation principale horizontale, en liens inter-pages. Visuellement inspirée du pattern tabs (indicateur bordure pleine hauteur), mais sémantiquement correcte : <nav> + <a> + aria-current="page", jamais role="tablist". Main horizontal navigation, inter-page links. Visually inspired by the tabs pattern (full-height border-bottom indicator), but semantically correct: <nav> + <a> + aria-current="page", never role="tablist".

Le site Agentica lui-même n'utilise pas <agtc-top-nav> sur ses propres pages — sa navigation est du HTML écrit à la main (.site-nav) qui consomme les mêmes tokens (ADR-087). Ce choix d'intégration du site ne change rien au contrat ci-dessous, applicable à tout consommateur qui monte le vrai composant. The Agentica site itself does not mount <agtc-top-nav> on its own pages — its nav is hand-written HTML (.site-nav) consuming the same tokens (ADR-087). This site-integration choice does not change the contract below, which applies to any consumer that mounts the real component.

AperçuPreview

Distinction avec agtc-tabsDistinction from agtc-tabs

agtc-top-navagtc-tabs
Sémantique ARIAARIA semanticsrole=navigation + <a>role=tablist + role=tab + role=tabpanel
Navigation clavierKeyboard navigationTab + EnterFlèches ←/→ + Home/EndArrows ←/→ + Home/End
État actifActive statearia-current="page"aria-selected="true"
EffetEffectNavigation inter-pagesInter-page navigationPanneau de contenu in-pageIn-page content panel

Règles absoluesAbsolute rules

Tokens de composantComponent tokens

Token CSSRéférenceReferenceValeurValue
--agtc-component-top-nav-tab-colorsemantic.color.text.secondary#646464
--agtc-component-top-nav-tab-color-hoversemantic.color.text.primary#202020
--agtc-component-top-nav-tab-background-hoversemantic.color.background.subtle#f0f0f0
--agtc-component-top-nav-tab-color-activesemantic.color.action.primary#007a68
--agtc-component-top-nav-tab-indicator-colorsemantic.color.action.primary#007a68
--agtc-component-top-nav-tab-font-weight-activesemantic.fontWeight.bold700
--agtc-component-top-nav-tab-focus-ringsemantic.color.border.focus#007a68
--agtc-component-top-nav-cta-backgroundsemantic.color.action.primary#007a68
--agtc-component-top-nav-cta-background-hoversemantic.color.action.primary-hover#0d3d38
--agtc-component-top-nav-cta-colorsemantic.color.text.on-action#ffffff
--agtc-component-top-nav-cta-radiussemantic.radius.control6px

AccessibilitéAccessibility

ImplémentationImplementation

<agtc-top-nav nav-label="Main navigation"></agtc-top-nav>
<script>
  const nav = document.querySelector('agtc-top-nav');
  nav.items = [
    { label: 'Tokens',      href: '../tokens/' },
    { label: 'Components',  href: '../components/' },
    { label: 'Get started', href: '../get-started.html', cta: true },
  ];
  nav.current = window.location.pathname;
</script>

DOs et DON'TsDOs and DON'Ts

À faireDo

  • Gérer la langue (labelFr/labelEn) côté consommateur, pas dans le composantHandle language (labelFr/labelEn) on the consumer side, not in the component
  • Utiliser pour une navigation inter-pages réelleUse for real inter-page navigation

À éviterDon't

  • Utiliser pour un contenu in-page sans changement de page (→ agtc-tabs)Use for in-page content with no page change (→ agtc-tabs)
  • Ajouter un border-radius aux liens d'ongletAdd border-radius to the tab links

UX Patterns Reference

PatternSourceAppliedJustification
Navigation landmark <nav aria-label>W3C WAI Landmarks✅Invisible to AT without a landmark
aria-current="page" on the active linkWCAG 2.4.4 / 4.1.2✅CSS class alone is insufficient
Full-height border-bottom indicatorNN/g — Horizontal Navigation✅Filled background = toggled button
No role="tablist" for inter-page navW3C APG Tabs✅Incorrect semantics without a panel
Visually distinct CTA (pill button)IxDF — Clear primary action✅Adoption is an action, not a destination
:visited neutralizedADR-047✅Navigation ≠ read/unread content
Mobile hamburger + aria-expandedNN/g — Mobile nav✅No horizontal scrolling
Contribuer à ce projet Contribute to this project

Ce système est ouvert aux contributions — tokens, composants, décisions architecturales, corrections d'accessibilité ou documentation. Toute amélioration est bienvenue. This system welcomes contributions — tokens, components, architectural decisions, accessibility fixes, or documentation. Every improvement counts.

Voir sur GitHub View on GitHub