# WorkNav

> Work section sub-navigation: a back-to-index action plus previous/next controls for stepping through the portfolio case studies.

- Status: stable
- Group: navigation
- Page: https://www.digitaltableteur.com/design-system/components/work-nav
- Contract: https://www.digitaltableteur.com/contracts/v1/WorkNav.contract.json

## When to use

Sub-navigation for the work section. Renders a back-to-work action and previous/next controls that step through the case-study sequence, disabling the edges. The controls are buttons that navigate through router.push (or onNavigate), not links. Portfolio chrome; site-wide nav lives in SiteHeader.

## When not to use

- Do not hardcode a second project sequence in an application wrapper; pass the live ordered pages collection.
- Do not use WorkNav outside portfolio case-study chrome.

## Look-alikes

The contract names no look-alike with a deciding condition.

## Props

| Prop | Type | Default | Description | Required |
| --- | --- | --- | --- | --- |
| `currentPath` | `string` | none | Active route used to compute the prev/next disabled state. Defaults to the current pathname from the router; stories and tests override it to show a given position in the work sequence. | No |
| `pages` | `readonly WorkNavPage[]` | none | Ordered case-study paths. Defaults to the published project catalog in its display order. | No |
| `onNavigate` | `(path: string) => void` | none | Host navigation callback. Defaults to the configured navigation runtime. | No |
| `disabled` | `boolean` | `false` | Disables every action while host navigation is pending. Defaults to `false`. | No |

## Variants

No variant dimensions and no props with a fixed set of values.

## Invalid combinations

The contract records no invalid combinations.

## Keyboard

The contract records no keyboard interaction.

## Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

| Level | Rule | How it is checked |
| --- | --- | --- |
| MUST | ARIA: Wrapped in a nav landmark labelled via aria-label (workNavLabel) | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | ARIA: Each Button's icon is decorative (aria-hidden), so the visible label, or the visually clipped label at narrow widths, is the only accessible name and is announced once. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | ARIA: The controls are buttons that call router.push (or onNavigate), not links: they announce as buttons inside the nav landmark and cannot be opened in a new tab. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | Required stories produce no axe violations at the configured severity. | Automated by `npm run test:stories:matrix:ci`. WCAG 2.5.8. |
| MUST | The accessibility tree (role, name, state) matches the committed snapshot for every required story. | Automated by `npm run test:stories:matrix:ci`. WCAG 1.3.1, 4.1.2. |
| MUST | The component remains legible and operable under a real browser forced-colors: active pass. | Automated by `npm run test:stories:hc`. |
| MUST | A human completed an end-to-end accessibility review of this component. | Manual review, last on 2026-11-04. |
| SHOULD | Pass the ordered project registry so navigation stays synchronized with published work. | Not stated in the contract. |
| SHOULD | Use onNavigate when the host needs prefetching, transitions, or navigation deduplication. | Not stated in the contract. |
| SHOULD NOT | Do not infer a next project for an unknown route; both adjacent controls intentionally disable. | Not stated in the contract. |

## Install and import

- In-repo only. WorkNav is not exported from `@digitaltableteur/react`, so there is no public import path.

## Links

- Machine-readable contract (Design System Contract 1.0): https://www.digitaltableteur.com/contracts/v1/WorkNav.contract.json
- Markdown version of this page: https://www.digitaltableteur.com/design-system/components/work-nav.md
- Component index as JSON: https://www.digitaltableteur.com/design-system/components.json
- All components: https://www.digitaltableteur.com/design-system/components
- Source: The implementation lives in a private repository. This page, its Markdown twin and the contract are generated from it at build time and are the public source of truth.
