diff --git a/README.md b/README.md index b94b0346..bf1eea31 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ This repository keeps user-facing and implementation notes inside the `docs/` fo - `docs/components/Accessibility.md` — Accessibility testing, a11y helpers, and issue #383 notes - `docs/components/ReputationPage.md` — Reputation page implementation and rendering states +- `docs/components/Navbar.md` — Navigation component examples, props, and accessibility patterns - `docs/data-model.md` — Data model and persistence guide - `docs/persistence.md` — Persistence API and local storage patterns - `docs/preferences.md` — Preferences provider and currency/locale helpers diff --git a/docs/components/Navbar.md b/docs/components/Navbar.md index d3658be9..566ded07 100644 --- a/docs/components/Navbar.md +++ b/docs/components/Navbar.md @@ -1,61 +1,143 @@ -# Navbar +# Navigation components -Accessible primary global navigation for the TalentTrust application. +This guide covers the current navigation primitives used throughout TalentTrust: -## Overview +- `Navbar` for the primary global links +- `Breadcrumbs` for page-level navigation context +- `RouteAnnouncer` for screen-reader announcements after client-side route changes -`Navbar` renders persistent links to the three core application routes: -`/contracts`, `/milestones`, and `/reputation`. It is mounted inside the -sticky header in `src/app/layout.tsx` and uses `next/link` with -`usePathname` for client-side navigation and active-route highlighting. +## Quick start -## File Location +A typical app-shell layout mounts these components once near the top of the tree: -- Component: `src/components/Navbar.tsx` -- Tests: `src/components/__tests__/Navbar.test.tsx` +```tsx +import Navbar from '@/components/Navbar'; +import Breadcrumbs from '@/components/Breadcrumbs'; +import RouteAnnouncer from '@/components/RouteAnnouncer'; + +export default function AppShell({ children }: { children: React.ReactNode }) { + return ( + <> +
+ +
+ +
+ + {children} +
+ + + + ); +} +``` + +## Navbar + +### Overview + +`Navbar` renders the primary application links for `/contracts`, `/milestones`, and `/reputation`. It uses `next/link` and `usePathname` from `next/navigation` to highlight the current route with `aria-current="page"`. + +### Props + +| Prop | Type | Required | Description | +|------|------|----------|-------------| +| None | — | — | `Navbar` accepts no props. The route list is internal and fixed. | + +### Example + +```tsx +
+ +
+``` + +### Accessibility and behavior + +- Wrapping element: `