# Page scroll nav — pattern

> **Agents:** `.cursor/rules/exxat-page-scroll-nav.mdc`

**Job:** on a long page (or a long table on a hub) you can get back to the top in one action, and on a page made of sections you can see where you are and jump to another.

## Parts

| Part | Behavior |
|------|----------|
| **Back to top** | Round secondary icon button, bottom end of the page. Appears after the page scrolls `backToTopThreshold` px (default 480); inert while hidden. Click scrolls to the top and returns focus to `#main-content`. |
| **Outline rail** | Top end of the page, `md` and up. One tick per section, current one emphasised. Hover or focus opens a card of `Marker` rows; picking one scrolls there, leaving 64 px above the title. Needs `minSections` (default 3). |

## Wiring

- `PrimaryPageTemplate` renders `<PageScrollNav />` once, inside the `relative` `SidebarInset`. The scrollport is `[data-page-scroll]`.
- Mark each section: `<section data-outline-section="Requirements">…</section>`. Design OS catalogue sections and doc sections are already marked.
- Inside a bounded scroller, pass `scrollRef` and place the nav in a `relative` wrapper (see the Page scroll nav catalogue page).

## Why it mirrors Ask Leo

Ask Leo's transcript has a tick rail with a jump card (`LeoTranscriptOutline`) and a jump-to-start button (`MessageScrollerButton`). Same job, same look, so people learn it once.

## Not for

Pages that do not scroll (`containScroll`, focus workspaces) — nothing shows because nothing scrolls.
