React-PDF

Display PDF documents in your React app as easily as if they were images

Library
npm
v11.0.0
11,193 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 92
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
82 /100 Excellent
Architecture 84
Code Quality 86
Innovation 78
Learning Curve 80

React-PDF wraps Mozilla’s PDF.js to let React applications render PDF documents as a set of composable components — Document, Page, Outline, and Thumbnail — rather than embedding a raw <iframe> or <embed>. It handles pagination, text selection, annotations, and password-protected files, and renders pages to canvas or SVG so PDFs behave like any other React-controlled visual element.

Maintained by Wojciech Maj, the library is organized as a Yarn workspace monorepo with a single published package and ships full TypeScript types. It’s a common building block for document viewers, e-signature flows, invoice/report previews, and any product that needs in-browser PDF rendering without relying on the browser’s built-in PDF plugin.

What You Get

  • Document and Page components that render individual PDF pages to canvas or SVG
  • Built-in text layer and annotation layer rendering for selectable text and clickable links
  • Outline and Thumbnail components for table-of-contents navigation and page previews
  • Password-protected document handling with a configurable password callback flow
  • Full TypeScript type definitions and tree-shakeable ESM output

Common Use Cases

  • Building in-app document viewers/previewers for invoices, contracts, or reports
  • Rendering PDFs inline in e-signature or document-review workflows without a browser plugin
  • Displaying paginated PDF thumbnails and outlines for multi-page document navigation
  • Embedding text-selectable, searchable PDF content directly in a React SPA

Under The Hood

Architecture - The package is a thin, component-oriented layer over Mozilla’s pdfjs-dist: Document loads and parses the PDF via a PDF.js worker (pdf.worker.entry.ts), exposing document/page state through React context (DocumentContext, PageContext) that child Page, Outline, and Thumbnail components consume to render canvas, SVG, text, and annotation layers independently. Tech Stack - A Yarn 4 workspaces monorepo (packages/react-pdf) written in TypeScript, built with tsc to ESM output, using Biome for linting/formatting and Vitest for unit tests, with pdfjs-dist as its core rendering dependency. Code Quality - Nearly every component ships alongside a co-located .spec.tsx/.spec.ts test file (Document, Page, Outline, Thumbnail, AnnotationLayer, StructTree, etc.), combined with strict TypeScript and Biome lint/format gates run in the test script before publish. API Design - The compositional API (<Document file={...}><Page pageNumber={1} /></Document>) mirrors familiar React patterns and keeps common cases low-boilerplate, while advanced needs (custom loaders, password prompts, worker configuration) are handled through well-documented props and context rather than escape hatches.

Used by 23 apps in this directory

TypeScript
94%
Other

Termix

Devops

15,644

Manage all your servers — SSH terminals, remote desktops, file transfers, and Docker containers — from a single self-hosted browser interface.

View details
84
Repo Health
67
Technical
73
Dependency
Built with
TypeScript 94%
Updated 1 weeks ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 6 days ago
JavaScript
74%
AGPL 3.0

Twake Drive

Collaboration · File Storage

989

Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.

View details
91
Repo Health
78
Technical
71
Dependency
Built with
JavaScript 74%
TypeScript 25%
Updated 1 weeks ago
Python
73%
Apache 2.0

Unsloth

AI Assistants · AI Development

78,493

Run and fine-tune LLMs, diffusion, audio and embedding models on your own hardware, from a native desktop app, a browser UI, or a Python library.

View details
89
Repo Health
83
Technical
70
Dependency
Built with
Python 73%
TypeScript 22%
Updated 6 days ago
TypeScript
96%
GPL 3.0

Wire

Collaboration · Team Chat · Video Conferencing

1,192

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
68
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers