---
description: Back-to-top and section outline for long pages — PageScrollNav, mounted once by PrimaryPageTemplate
globs: "**/ui/page-scroll-nav.tsx,**/templates/primary-page-template.tsx"
alwaysApply: false
appliesTo: [react]
---

# Exxat DS — page scroll nav (MUST)

`PageScrollNav` (`@exxatdesignux/ui/components/ui/page-scroll-nav`) gives every long page a **Back to top** button and, when the page has sections, an **outline rail**. Pattern doc: **`docs/exxat-ds/page-scroll-nav-pattern.md`**.

- **Mounted once**, by `PrimaryPageTemplate`, next to the `[data-page-scroll]` scrollport. Do **not** mount it per page or per hub.
- **Sections opt in** with `data-outline-section` on the wrapping element. The value is the label; with an empty value the first `h1`–`h3` is used. Three or more sections shows the outline.
- **Do not** build a second "jump to section" rail, a page-local back-to-top, or scroll `window`. The page scrolls in `[data-page-scroll]`.
- It is the page counterpart of Ask Leo's Transcript Outline (`LeoTranscriptOutline`) and `MessageScrollerButton direction="start"`; keep their look (tick rail, `Marker` rows, round secondary button) in step.
- Back to top is **inert** (`inert`, `tabIndex=-1`) while hidden and returns focus to `#main-content`; smooth scroll is off under `prefers-reduced-motion`.
- A bounded region (a card with its own scroll) passes `scrollRef` instead of relying on `[data-page-scroll]`.
