React-PDF

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

Library
npm
v11.0.0
11,179 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 22 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
89%
Other

anytype-ts

Collaboration · Knowledge Management · Note Taking

8,861

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
88%
MIT

DevTools-X

Developer Tools

1,534

41 offline-first developer utilities in a single 10MB cross-platform desktop app — no Electron, no cloud, no compromise.

View details
49
Repo Health
68
Technical
68
Dependency
Built with
TypeScript 88%
Updated 4 months ago
Go
62%
Apache 2.0

Harness Open Source

Code Editors · Developer Tools · Devops

38,450

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
89
Repo Health
79
Technical
64
Dependency
Built with
Go 62%
TypeScript 33%
Updated 1 weeks ago
TypeScript
100%
Apache 2.0

ILLA Builder

Design Tools · Developer Tools · Low Code Platforms

12,327

Open-source low-code platform for building internal tools with drag-and-drop UI, reactive data bindings, and real-time collaboration.

View details
56
Repo Health
71
Technical
63
Dependency
Built with
TypeScript 100%
Updated 4 months ago
TypeScript
64%
Apache 2.0

Laminar

AI Development · Monitoring

3,285

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 64%
Rust 34%
Updated 5 days ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 4 days ago
TypeScript
99%
Other

LobeHub

AI Assistants · Automation · Productivity

82,864

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript 99%
Updated 4 days ago
JavaScript
55%
Other

Lokus

Knowledge Management · Note Taking

802

Local-first note-taking with graph view, canvas & AI plugins—your Markdown files, zero telemetry, blazing-fast Rust performance.

View details
78
Repo Health
75
Technical
65
Dependency
Built with
JavaScript 55%
HTML 21%
Rust 12%
Updated 1 months 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