PACKAGE · PDF

@react-pdf/renderer

Create PDF files on the browser and server

WEEKLY DOWNLOADS 1.9M
STARS 16.6K
FORKS 1.3K
OPEN ISSUES 411
GZIP SIZE 471.5 kB
UNPACKED SIZE 292.4 kB
DEPENDENCIES 13
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

@react-pdf/renderer downloads — last 12 months

Download trends for @react-pdf/renderer1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.03.5M7.1M10.6M14.2MJun 2025SepDecMarMay 2026
@react-pdf/renderer
ABOUT @REACT-PDF/RENDERER

@react-pdf/renderer is a JavaScript library designed to generate PDF documents directly within a React application, running on both the client and server. It tackles the common challenge of creating dynamic, data-driven PDFs without relying on external print services or complex server-side rendering pipelines, making PDF generation a fully integrated part of your React ecosystem.

The core philosophy behind @react-pdf/renderer is to provide a declarative, component-based API for PDF creation, mirroring the familiar React paradigm. This allows developers to leverage their existing React knowledge and build UI components that render as PDFs, targeting a broad audience from front-end developers to full-stack teams.

Key API patterns include using standard React components like View, Text, Image, and Style sheets to define the layout and content. Developers can utilize a CSS-like styling system and Flexbox for layout, much like building web UIs. The `Document`, `Page`, `View`, and `Text` components are fundamental building blocks for structuring PDF content.

Integration is seamless within React projects. It fits naturally into workflows where React is used for the front-end, server-side rendering (SSR) frameworks like Next.js, or even Node.js environments for backend PDF generation. This allows for consistent PDF generation logic across different deployment scenarios.

With 2.5M weekly downloads and 16.5K GitHub stars, the package is mature and widely adopted. The unpacked size is 292.4 kB, with a gzipped bundle size of 584.3 kB, which is a trade-off for its comprehensive features and React-native-like API. The last update was April 15, 2026, indicating ongoing maintenance.

Developers should be aware that @react-pdf/renderer is a client-side PDF generator and does not support all CSS properties or advanced PDF features like forms or JavaScript execution within the PDF. Interactive elements common in web PDFs are not directly supported, and complex layouts might require careful management of page breaks and element flow.

WHEN TO USE
  • When you need to generate PDF invoices or reports directly from your React application's state.
  • When leveraging the familiar React component model to define PDF layouts and content.
  • When integrating PDF generation into server-side rendering workflows using frameworks like Next.js.
  • When creating downloadable documents based on user input or dynamic data within a React front-end.
  • When you need a PDF generation solution that operates entirely within the JavaScript ecosystem, avoiding external dependencies.
  • When utilizing Flexbox for page layout to achieve responsive and structured PDF designs.
  • When generating printable versions of complex UI components with dynamic content.
WHEN NOT TO USE
  • If you require interactive PDF features such as form fields or embedded media, consider a dedicated PDF form generation tool.
  • If your PDF generation needs are exceptionally simple and do not warrant a full React component tree, a simpler text-based PDF library might suffice.
  • If you need to support the full spectrum of advanced PDF features like JavaScript execution within the document or complex annotations, look for a more powerful, native PDF generation engine.
  • When generating PDFs in an environment where a full Node.js runtime or browser DOM is unavailable and a more lightweight CLI tool is preferred.
  • If the overhead of integrating a React build process for PDF generation is prohibitive in your existing non-React project. Older browser environments with limited JavaScript capabilities might also pose compatibility challenges.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 4
@react-pdf/renderer vs puppeteer ★ 93.5K · 5.3M/wk @react-pdf/renderer vs pdfkit ★ 10.7K · 2.0M/wk @react-pdf/renderer vs jspdf ★ 31.2K · 7.7M/wk @react-pdf/renderer vs pdfjs-dist ★ 53.4K · 8.9M/wk