# Side navigation

> A quiet rail of a project’s modules, grouped the way the breadcrumb’s module menu groups them.

Source: https://kwark.space/designSystem/components/side-navigation

## Usage

### What it is
Kwark does not have a permanent sidebar today. Moving between modules happens in the breadcrumb: **Prepare to shoot ▾ › Breakdown ▾** opens a left-aligned menu of every module, grouped *Bound to the script*, *Departments*, *Draws on the script* (Decision 0044). This component is that same menu, laid open as a rail, for a wide desktop window where someone moves between Breakdown, Schedule and Budget all day.

Decision 0044 names a persistent sidebar as the thing that would retire the module dropdown. Until a founder decision says otherwise, the rail is an option for production-office screens at 1280px and wider, never a second copy of the breadcrumb on the same screen.

### When to use
- A production-office desk (Prepare to shoot) on a wide screen, where switching module is the most frequent action.
- A settings window with five or more sections (Account, Production house, Rooms, Shortcuts, Privacy).

### When not to use
- On phones. The phone has one 44px header and a Menu sheet (Decision 0016). The rail turns into the **Menu ▾** sheet.
- In the screenplay editor. It keeps its five menus and nothing else (Decision 0015).
- Beside a breadcrumb that already offers the module menu: one place for the same thought.

### Variants
| Variant | Use for |
|---|---|
| Grouped rail | Prepare to shoot: groups with the same tone dots as the breadcrumb menu (script red, departments slate blue, draws amber) |
| Flat rail | Settings: no groups, at most nine rows |
| Collapsed | Not offered. A rail of bare icons fails "a control says what it is, with a word". |

### Writing
- Rows carry the module’s own name, exactly as on its card and in the breadcrumb: *Schedule & Call Sheets*, not *Scheduling*.
- Group headings are the three groups Kwark already uses. Do not invent new groupings per screen.

## Style

### Anatomy

1. **Rail**: 240px wide, `--k-surface`, 1px `--k-line` on its inner edge, 8px padding.
2. **Project row**: home glyph 14px and the story’s name, 14px Poppins 500, 36px tall. It returns to Project home (Decision 0018).
3. **Group heading**: a 6px square dot in the group tone, then the group name in 12px Poppins 600, `--k-text-2`. In the app’s breadcrumb menu this heading is upper case with 0.08em tracking; the system writes it in sentence case.
4. **Row**: 36px tall (44px under a thumb), 4px 12px padding, 6px corners, icon 14px in `--k-text-2`, label 14px Poppins 500.
5. **Current row**: background `color-mix(--k-accent 18%, transparent)`, a 14px tick in `--k-accent-soft`, `aria-current="page"`. The same treatment as `.k-crumb-menu__row.is-current`.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-surface` | #ffffff | #1a1a1a |
| `--k-raise` | #f1f5f9 | #252525 |
| `--k-line` | #e2e8f0 | rgba(255, 255, 255, .1) |
| `--k-text` | #0f172a | #e3e3e3 |
| `--k-text-2` | #5b6779 | #9ca3af |
| `--k-accent` | #98633f | #98633f |
| `--k-accent-soft` | #e8b58b | #e8b58b |
| `--k-danger` | #b4382c | #e0685c |
| `--k-kind-performance` | #5f7393 | #a9b8cf |
| `--k-warn` | #8a5a00 | #d8a44a |
| `--k-radius-control` | 6px |  |
| `--k-fs-body` | 14px |  |
| `--k-fs-meta` | 12px |  |

## Code

### React

Use the HTML below with `kwark.css`. The example shows the markup and styling. Supply any application behavior described on this page.

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<nav class="kw-railnav" aria-label="Untitled Story modules">
  <a class="kw-railnav__project" href="#"><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><span>Untitled Story</span></a>
  <p class="kw-railnav__group"><i data-tone="script"></i>Bound to the script</p>
  <a class="kw-railnav__row is-current" href="#" aria-current="page"><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="M12.6 2.6A2 2 0 0 0 11.2 2H4a2 2 0 0 0-2 2v7.2a2 2 0 0 0 .6 1.4l8.7 8.7a2.4 2.4 0 0 0 3.4 0l6.6-6.6a2.4 2.4 0 0 0 0-3.4z"/><circle cx="7.5" cy="7.5" r=".5"/></svg><span>Breakdown</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="M20 6 9 17l-5-5"/></svg></a>
  <a class="kw-railnav__row" href="#"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M3 15h18M12 3v18"/></svg><span>Shots &amp; Boards</span></a>
  <a class="kw-railnav__row" href="#"><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.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z"/><path d="m6.2 5.3 3.1 3.9M12.4 3.4l3.1 4M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/></svg><span>Schedule &amp; Call Sheets</span></a>
  <a class="kw-railnav__row" href="#"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><path d="M16 2v4M8 2v4M3 10h18"/></svg><span>Calendar</span></a>
  <p class="kw-railnav__group"><i data-tone="departments"></i>Departments</p>
  <a class="kw-railnav__row" href="#"><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="m16 13 5.2 3.5a.5.5 0 0 0 .8-.4V7.9a.5.5 0 0 0-.8-.4L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg><span>Camera &amp; Light</span></a>
  <p class="kw-railnav__group"><i data-tone="draws"></i>Draws on the script</p>
  <a class="kw-railnav__row" href="#"><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 10c0 5-5.5 10.2-7.4 11.8a1 1 0 0 1-1.2 0C9.5 20.2 4 15 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/></svg><span>Filming locations</span></a>
  <a class="kw-railnav__row" href="#"><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="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8"/></svg><span>Cast &amp; Crew</span></a>
  <a class="kw-railnav__row" href="#"><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="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/></svg><span>Budget</span></a>
</nav>
```

## Accessibility

### Keyboard
| Key | Does |
|---|---|
| Tab | Moves into the rail, to the current row first, then out. |
| Up / Down | Optional roving focus between rows; Tab alone must also work. |
| Enter | Opens the module. |

### ARIA
- `<nav aria-label="Untitled Story modules">`: name the landmark after the project so it is distinct from the breadcrumb’s `aria-label="Breadcrumb"`.
- Group headings are plain text, not buttons. Rows are links (`<a href>`), because they navigate.
- The current row carries `aria-current="page"`; the tick is `aria-hidden`.

## For agents

### Rules

- **Must** use the module names and the three groups from the breadcrumb module menu (Decision 0044); never rename a module for the rail.
- **Never** show the rail and the breadcrumb module dropdown on the same screen.
- **Never** show the rail on phones or in the screenplay editor (Decisions 0015, 0016).
- **Always** mark the current module with `aria-current="page"` and the accent tint, never with colour alone.
- **Never** offer an icon-only collapsed rail.

### AI readiness test

**Task:** Add a side navigation to the Prepare to shoot desk for a 1440px window.

**Give the agent:** This page, the Breadcrumb page, Decision 0044.

**Constraint:** The breadcrumb stays on screen.

**A reliable answer:**
- Notices the conflict with the breadcrumb module dropdown and asks which one goes
- Uses the groups Bound to the script, Departments, Draws on the script
- Marks Breakdown with aria-current="page"
- Hides the rail under 768px
