wojtekmaj/react-pdf

Display PDFs in your React app as easily as if they were images.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 54 minutes ago
Type:Library / SDKCategory(s):UI Components & Design SystemsWeb Development
Added to GitGenius on June 16th, 2026
Created on August 1st, 2016
Open Issues & Pull Requests: 17 (+0)
GitHub issues: Enabled
Number of forks: 1,002
Total Stargazers: 11,169 (+0)
Total Subscribers: 59 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 39.4 hours
Mean response time: 16.9 days
90th percentile: 44.2 days
Tracked items: 203

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 6% of issues opened in the past year have been closed. Three people close 84% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 7
New in 7 days: 3
Closed in 7 days: 4
Avg open age: 530 days
Stale 30+ days: 5
Stale 90+ days: 4

Recent activity

Opened in 7 days: 2
Closed in 7 days: 4
Comments in 7 days: 7
Events in 7 days: 13

Top labels

  • bug (127)
  • stale (100)
  • question (73)
  • enhancement (31)
  • invalid (12)
  • duplicate (8)
  • fresh (8)
  • help wanted (5)

Detailed Description

React-PDF is a TypeScript-based React component library that enables developers to display PDF documents directly within React applications with minimal setup. The library abstracts away the complexity of PDF rendering by providing simple Document and Page components that work similarly to standard image elements, making PDF integration straightforward for web developers.

The core functionality centers on two primary components. The Document component accepts a file prop that can be a URL, base64-encoded content, Uint8Array, or other formats, while Page components nested within Document render individual pages. This compositional approach aligns with React's component philosophy and allows developers to control which pages display and how they appear in their applications. An online demo and sample directory demonstrate the library's capabilities and provide working examples for developers getting started.

React-PDF relies on PDF.js for its underlying PDF parsing and rendering capabilities. The library requires explicit configuration of the PDF.js worker, which handles the heavy computational work of processing PDF files. Developers have multiple configuration options including importing the worker directly, copying it to a public directory, or using an external CDN. The documentation emphasizes that worker configuration must occur in the same module where PDF components are used to avoid module execution order issues, particularly important for Next.js users who need to disable server-side rendering for PDF-containing components.

The library supports several advanced features through optional stylesheet imports and configuration. Annotations such as links can be rendered with appropriate styling, while a text layer feature enables text selection and searching within displayed PDFs. For documents containing non-Latin characters, developers can configure character map files from pdfjs-dist. JPEG 2000 image support requires additional wasm directory configuration, and PDFs using deprecated standard fonts need font files copied to the build output.

React-PDF maintains broad browser compatibility aligned with PDF.js support across modern browsers, though developers can extend support to older browsers through polyfills and legacy PDF.js workers. The library requires React 16.8 or later and also works with Preact. It supports multiple bundlers including Webpack and Vite, with specific configuration guidance provided for each.

The repository's contributor network overlaps with major projects including Microsoft's VSCode and TypeScript repositories as well as the Rust language repository, suggesting its use in significant development tooling ecosystems.

The library is actively developed across multiple version branches, with version 10.x representing the current focus while documentation remains available for versions 5.x through 9.x. This version management approach allows developers to choose stability or access newer features based on their project requirements.