GitHub

FileViewerPageRail

Controlled page rail navigation for custom document compositions.

Use a controlled page rail when the document handle and current page are owned outside the easy renderer API. PDF exposes this lower-level shape as PdfThumbnailRail.

<PdfThumbnailRail
  resource={resource}
  currentPage={currentPage}
  onSelectPage={scrollToPage}
  thumbnailWidth={120}
  thumbnailShape="page"
/>

Behavior

  • Fully controlled: you pass the resource, the highlighted currentPage, and an onSelectPage handler that jumps the document. The rail holds no page state of its own.
  • Pair it with a renderer's imperative handle — e.g. PdfViewerHandle.scrollToPage — so clicking a thumbnail scrolls the surface to that page.
  • Prefer renderer-bound FileViewerThumbnails (PdfViewerThumbnails) for normal compositions; reach for the controlled rail only when another workflow already owns page state.

API Reference

PdfThumbnailRail — the controlled rail:

PropTypeDescription
resourceViewerResourceSame resource object passed to the document renderer. Required.
currentPagenumber | null1-based page whose thumbnail is highlighted.
onSelectPage(page: number) => voidFired with the 1-based page when a thumbnail is clicked.
thumbnailWidthnumberThumbnail image width in CSS px. The sidebar shell owns rail width.
thumbnailShape"page" | "square"Preserve page aspect (page) or crop into a square frame.
classNamestringOptional class on the rail.

Source

pdf-viewer-thumbnails.tsx