Skip to content
React PDF Viewer

Search

Requirements

The React, PDF.js, bundler and browser versions React PDF Viewer is tested with.

Only versions covered by the project’s automated tests are listed here. Other versions may work but are not verified.

Prerequisites

DependencySupportedTested in CI
react, react-dompeer >=18.0.018.3 and 19.3
pdfjs-distpeer ^6.0.06.3
TypeScript (optional)declarations target modern TypeScript6.0
Node.js (for building your app)>=2022

The package is ESM-only and has no runtime dependencies besides its peers.

Bundlers and frameworks

Each of these is exercised by a consumer smoke test that installs the packed package into a fresh app and builds it for production:

TargetTested versionGuide
Vite8.3Vite
Next.js (App Router, server rendering)16.3Next.js
webpack5.111webpack

Browsers

Browser tests run in the current versions of Chromium, Firefox and WebKit (Playwright engines). PDF.js 6 relies on recent browser APIs, so use current browsers, or the legacy PDF.js build for older ones; see PDF.js configuration. Microsoft Edge (Chromium) and Safari (WebKit) share those engines but are not tested separately.

Installation

See Installation.

Minimal example

import { PdfViewer } from '@kingtech/react-pdf-viewer';
import '@kingtech/react-pdf-viewer/styles.css';

export const Viewer = () => <PdfViewer source="/files/report.pdf" />;

Verify

Your install matches the supported versions when npm ls react pdfjs-dist (or the pnpm/yarn equivalent) lists versions inside the ranges above and the minimal example renders the first page.

Next steps