# Breadcrumb

> Keep the project, phase and active module visible as a filmmaker moves between rooms.

Source: https://kwark.space/designSystem/components/breadcrumb

## Usage

### Choose the crumb
| Style | Use |
|---|---|
| Trail | Link to an ancestor. Keep a plain current label when it has no sibling destinations. |
| Dropdown | Open only the modules in the current phase. Preserve the module name on its trigger. |
| Split link | Link to the phase and put its alternate phases behind a separate chevron. |
| Collapsed | Keep Projects and the current room visible. Put trimmed ancestors under a named ⋯ button. |
| Chip | Show the production house as context. Leave it out of the path hierarchy. |

Decision 0044 defines the cross-module trail. Use the app’s ProjectModuleBreadcrumb adapter to get role-scoped module items. Decision 0016 replaces the desktop trail with the one-line header on phones.

### Separators
A 14px chevron-right (lucide `ChevronRight`) at 70% of the crumb colour, as `Breadcrumb.tsx` draws it. Never a typed `›` or `/`.

**Do:** *Blank Pages* ▸ *Prepare to shoot* with its own chevron ▸ **Call sheets** as a menu that names its scope.

**Don't:** A row of plain text joined by typed slashes, with a dropdown that hides which module is open.

## Style

### Anatomy

1. **Row**: flex, no wrap, 32px tall, 4px gap, 12px Poppins 500 in `--k-crumb-color`.
2. **Home**: a 32px square with the 14px home glyph, named *Projects*.
3. **Separator**: 14px chevron, 70% opacity.
4. **Item**: 32px, 8px side padding, 6px corners; hover `--k-raise`.
5. **Split link**: the phase link, then a separate 24px chevron button.
6. **Menu item**: the current module in `--k-text` with a 14px chevron that turns over when open; a 1px `--k-line` border while open.
7. **Menu**: the shared menu, left-aligned under its trigger; the current module ticked.
8. **Chip**: 24px pill, 1px line, the house name.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-crumb-height` | 32px |  |
| `--k-crumb-gap` | var(--k-space-1) |  |
| `--k-crumb-fs` | var(--k-fs-meta) |  |
| `--k-crumb-radius` | var(--k-radius-control) |  |
| `--k-crumb-pad-x` | var(--k-space-2) |  |
| `--k-crumb-color` | var(--k-text-2) |  |
| `--k-raise` | #f1f5f9 | #252525 |
| `--k-line` | #e2e8f0 | rgba(255, 255, 255, .1) |

## Code

### React

In the Kwark app: `import { Breadcrumb } from '@/components/ui/Breadcrumb'`.

```tsx
<Breadcrumb items={[
  { label: 'Home', link: '/', icon: Home, iconOnly: true },
  { label: 'Blank Pages', link: projectUrl },
  { label: 'Prepare to shoot', link: prepUrl, menu: phaseItems, menuLabel: 'Switch phase' },
  { label: 'Call sheets', menu: moduleItems, menuLabel: 'Switch module' },
]} />
```

| Prop | Type | Notes |
|---|---|---|
| `items` | `BreadcrumbItem[]` | Each item can carry a link, menu, or chip. |
| `noCollapse` | `boolean` | Use only where the complete trail fits. |

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<nav class="kw-crumb" aria-label="Project breadcrumb">
    <a class="kw-crumb__item kw-crumb__item--home" href="/designSystem" aria-label="Projects"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .7-1.5l7-6a2 2 0 0 1 2.6 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <a class="kw-crumb__item" href="/designSystem/kits/production-office">Blank Pages</a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <span class="kw-crumb__split"><a class="kw-crumb__item kw-crumb__item--split-link" href="/designSystem/kits/production-office">Prepare to shoot</a><button class="kw-crumb__item kw-crumb__item--chevron" type="button" aria-haspopup="menu" aria-expanded="false" aria-label="Switch phase"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button></span><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <button class="kw-crumb__item kw-crumb__item--menu" type="button" aria-haspopup="menu" aria-expanded="false" aria-label="Call sheets, switch module"><span aria-current="page">Call sheets</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button>
  </nav>
  <nav class="kw-crumb" aria-label="Compact breadcrumb">
    <a class="kw-crumb__item kw-crumb__item--home" href="/designSystem" aria-label="Projects"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .7-1.5l7-6a2 2 0 0 1 2.6 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <button class="kw-crumb__item kw-crumb__item--chevron" type="button" aria-haspopup="menu" aria-expanded="false" aria-label="Show hidden levels: Blank Pages, Prepare to shoot"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg></button><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <a class="kw-crumb__item" href="/designSystem/components/call-sheet">Call sheets</a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span><span class="kw-crumb__item kw-crumb__item--current" aria-current="page">Revision 2</span><span class="kw-crumb__chip">Thea Experience</span>
  </nav>
  <nav class="kw-crumb" aria-label="Breadcrumb with the module menu open" style="margin-bottom:132px">
    <a class="kw-crumb__item kw-crumb__item--home" href="/designSystem" aria-label="Projects"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .7-1.5l7-6a2 2 0 0 1 2.6 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <a class="kw-crumb__item" href="/designSystem/kits/production-office">Blank Pages</a><span class="kw-crumb__sep" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></span>
    <span class="kw-crumb__anchor"><button class="kw-crumb__item kw-crumb__item--menu" type="button" aria-haspopup="menu" aria-expanded="true" aria-label="Call sheets, switch module"><span aria-current="page">Call sheets</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button>
    <span class="kw-menu kw-crumb__menu" role="menu" aria-label="Prepare to shoot modules"><a class="kw-menu-item" role="menuitem" href="/designSystem/components/stripboard-strip">Schedule</a><a class="kw-menu-item" role="menuitem" href="/designSystem/components/call-sheet" aria-current="true">Call sheets <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></a><a class="kw-menu-item" role="menuitem" href="/designSystem/components/breakdown-page">Breakdown</a></span></span>
  </nav>
```

## Accessibility

Keep the phase link and its chevron distinct in the focus order. Name each chevron by its scope (*Switch phase*, *Switch module*). Escape closes the active menu and returns focus to its trigger. Give the current module `aria-current="page"`. Menu triggers carry `aria-haspopup="menu"` and `aria-expanded`.

## For agents

### Rules

- **Must** use Write and Prepare to shoot for the two project phases.
- **Must** preserve an addressable destination and focus return.
- **Never** show a desktop breadcrumb on a compact phone header.
- **Never** type a separator or chevron as text; draw the lucide chevrons.

### AI readiness test

**Task:** Add the phase and module trail to Call sheets.

**Give the agent:** Decision 0044 and this component.

**Constraint:** Some crew members have read-only access.

**A reliable answer:**
- Uses the shared project adapter
- Limits the module list by access
- Names both dropdowns
- Uses the compact Back and Menu on phones
