NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4357 most downloaded on npm
Display PDFs in your React app as easily as if they were images.
Last release 24 days ago
10 Sep 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
12 years old
157 releases · first in 2014
See Upgrade guide from version 10.x to 11.x .
See Upgrade guide from version 10.x to 11.x.
React-PDF 11 brings PDF loading into React's Suspense flow. Use the same loading fallbacks and Error Boundaries as the rest of your application, or keep your existing viewer behavior with suspense={false}.
This release also upgrades PDF.js to version 6, with improvements to rendering, accessibility, and performance, along with some important compatibility changes.
👀 Want to see exciting features more often? Consider sponsoring React-PDF.
❗️ = breaking change
Document, Page, Thumbnail, and Outline now use your boundary fallbacks for loading and failures.suspense={false} on Document to keep the previous loading and error behavior.startTransition to keep previously revealed content visible while loading another file or page.pdfjs directly, document/page proxies, or custom data factories, check the upgrade guide.onRenderAnnotationLayerSuccess now runs after asynchronous annotation rendering finishes, and rendering failures are reported through onRenderAnnotationLayerError.file and options objects are compared by value.One column per quarter.
Text layer styles are now in sync with PDF.js 5.4.296 ( #2077 ). If you were customizing text layer styles, note that --highlight-bg-color and --highl
--highlight-bg-color and --highlight-selected-bg-color moved from :root to .textLayer .highlight and are now semi-transparent, and that .textLayer z-index changed from 2 to 0.customTextRenderer is best-effort, and sanitizing it is up to you.Sanitize HTML returned by customTextRenderer ( #2070 ).
customTextRenderer (#2070).Added support for pageColors prop in Page component ( #2068 ). With this option, you can easily override colors used to render the PDF and implement a
pageColors prop in Page component (#2068).<Page /* … */ pageColors={{ background: 'black', foreground: '#FF0000' }} />Added support for filterAnnotations prop in Page component ( #1991 ).
This is our first release that uses OIDC trusted publishing and immutable releases ! 🎉
This is our first release that uses OIDC trusted publishing and immutable releases! 🎉
workerSrc module execution order (#2024).Added support for functions as children . React-PDF has never been simpler to work with! Say goodbye to onLoadSuccess , say goodbye to setting number
onLoadSuccess, say goodbye to setting number of pages in your own state, say goodbye to extra renders! Now, rendering a simple document is as trivial as:
<Document file="sample.pdf">
{({ pdf }) => Array(pdf.numPages)
.fill(null)
.map((_, index) => <Page key={index} pageIndex={index} />
))}
</Document>LinkService type for convenience.usePageContext will now provide non-null value sooner than before, before the page is actually loaded. This is uniform with how useDocumentContext behaves and with how types were designed from the start, so you should not be affected by this change.Fixed commonly used types not reexported.
This update includes a major PDF.js upgrade, new features to make your life easier, improved stability, and some important breaking changes.
See Upgrade guide from version 9.x to 10.x.
After more than a year since our last major release, we're thrilled to bring you React-PDF 10.
This update includes a major PDF.js upgrade, new features to make your life easier, improved stability, and some important breaking changes.
👀 Want to see exciting features more often? Consider sponsoring React-PDF.
❗️ = breaking change
scale prop in Document component, allowing you to set the scale for the entire document.pdfjs-dist, such as StructTreeNode, TextContent, TextItem, and TextMarkedContent, making it easier to work with PDF.js-provided types in your application.Fixed gray background appearing on selection ( #1925 ).
This version updates PDF.js to 4.8.69, significantly simplifying setup in Next.js. You no longer need to do any changes to Next.js config!
This version updates PDF.js to 4.8.69, significantly simplifying setup in Next.js. You no longer need to do any changes to Next.js config!
Fixed "Worker was terminated" error on unmount (#1062, #1877). Thanks, @CyberAndrii!
package.json exports not allowing to import package.json (#1876).Added support for isolatedDeclarations in TypeScript.
isolatedDeclarations in TypeScript.structTreeUtils.d.ts file, saving you 45 KB of disk space.React-PDF v8.0.2 and v7.7.3 have already included a mitigation of the issue and thus were not affected by this vulnerability, but caused automatic sec…
See Upgrade guide from version 8.x to 9.x.
This version updates PDF.js to 4.3.136, fixing GHSA-wgrm-67xf-hhpq for good. React-PDF v8.0.2 and v7.7.3 have already included a mitigation of the issue and thus were not affected by this vulnerability, but caused automatic security alerts due to the outdated PDF.js version.
❗️ = breaking change
.js to .mjs.svg renderMode.Promise.withResolvers polyfill when running Node.js versions older than 22.0.0.Force isEvalSupported to false. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).
isEvalSupported to false. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).This version shipped an incorrect fix for a security vulnerability and thus has been deprecated.
This version shipped an incorrect fix for a security vulnerability and thus has been deprecated.
isEvalSupported to true. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).See Upgrade guide from version 7.x to 8.x.
See Upgrade guide from version 7.x to 8.x.
❗️ = breaking change
propTypes were removed. If you’re using propTypes, we recommend migrating to TypeScript or another type-checking solution.Force isEvalSupported to false. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).
isEvalSupported to false. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).This version shipped an incorrect fix for a security vulnerability and thus has been deprecated.
This version shipped an incorrect fix for a security vulnerability and thus has been deprecated.
isEvalSupported to true. Fixes GHSA-87hq-q4gp-9wr4 (caused by GHSA-wgrm-67xf-hhpq).Fixed Outline, Page and Thumbnail components crashing when placed outside Document, but provided with pdf prop (#1709).
Outline, Page and Thumbnail components crashing when placed outside Document, but provided with pdf prop (#1709).vite-plugin-static-copy suggesting a solution that doesn't work on Windows.Updated documentation to make it clear SVG renderMode is deprecated and will be removed in the future.
renderMode is deprecated and will be removed in the future.tiny-warning with more popular (and equally tiny!) warning.Improved developer experience by moving prop documentation to JSDoc. This means that you can now see descriptions, default values, and examples for al
Package is now published with npm provenance statements.
Exported PasswordResponses type to make it easier to create custom password prompts (#1615). Thanks, @pstevovski!
PasswordResponses type to make it easier to create custom password prompts (#1615). Thanks, @pstevovski!options prop and usage with Next.js.Improved Next.js compatibility.
index.test.js entry not working in pure ESM mode with "moduleResolution": "node16" TypeScript option enabled.Fixed "Cannot set properties of undefined (setting 'workerSrc')" error in legacy Next.js setups (#1579).
Fixed "Cannot destructure property 'PDFDataRangeTransport' of 'pdfjs' as it is undefined." in legacy Next.js setups.
Fixed "Named export 'PDFDataRangeTransport' not found." error in some environments (#1578).
Added support for native ESM modules (#1574).
Added support for new renderMode: "custom". When set, you can pass custom renderer function to customRenderer prop (#1408).
renderMode: "custom". When set, you can pass custom renderer function to customRenderer prop (#1408).'use client'; to the parent component for this component to work.options prop value (#1567).@types/react and @types/react-dom are now optional peerDependencies, which eliminates errors caused by duplicate typings.Updated clsx dependency to 2.0.0 to enable ESM support in the near future.
clsx dependency to 2.0.0 to enable ESM support in the near future.Fixed customTextRenderer not working on documents without marked content (#1530, #1531). Thanks, @MattL75!
customTextRenderer not working on documents without marked content (#1530, #1531). Thanks, @MattL75!Improved performance by avoiding unnecessary re-renders (#1526).
Large and exciting release, full of improvements and new features, mainly thanks to our contributors, @kostassite, @iamandrewluca and @MattL75, and sp
Large and exciting release, full of improvements and new features, mainly thanks to our contributors, @kostassite, @iamandrewluca and @MattL75, and sponsors. Become a sponsor and help making React-PDF even better!
Thumbnail component which lets you render thumbnails (#898, #1519).pdf.annotationStorage in pdf provided in onDocumentLoadSuccess callback and listen for form data changes (#1518). Thanks, @kostassite!useDocumentContext, useOutlineContext and usePageContext. These hooks allow you to build custom components that hook (pun not intended) into React-PDF API (#1505). Thanks, @iamandrewluca!onItemClick was not provided neither to Document nor Outline components, React-PDF will now attempt to navigate to the page of the clicked outline item on its own, just like it does for internal links.Page: onGetStructTreeSuccess and onGetStructTreeError (#1494, #1498). Thanks, @MattL75!onItemClick types incorrectly marking dest as required.onItemClick not passed from Document to Outline. Previously, you had to manually pass onItemClick to Outline component. Now, you only need to pass it to Document.Allowed all DocumentInitParameters to be passed to options prop.
DocumentInitParameters to be passed to options prop.Fixed "Worker was destroyed" error when Document was unmounted or updated before the worker finished loading the PDF file.
section selector styled.Fixed annotation layer rendered under text layer, resulting in some annotations not clickable (#1503). Thanks, @iamandrewluca!
I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped th…
See Upgrade guide from version 6.x to 7.x.
This is one of the biggest update - for React-PDF and for me personally. React-PDF has been rewritten from scratch using TypeScript and React Hooks. I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped through 137 unit tests we have, please let me know. I hope you will like it.
❗️ = breaking change
renderInteractiveForms prop.--scale-factor CSS-variable must be set" error.Fixed propTypes that could have crashed SSR.
Fixed black flicker when rendering canvas (#1340, #1279). Thanks, @MattL75!
Fixed "The --scale-factor CSS-variable must be set" error.
--scale-factor CSS-variable must be set" error.I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped th…
This is one of the biggest update - for React-PDF and for me personally. React-PDF has been rewritten from scratch using TypeScript and React Hooks. I've put a tremendous amount of effort to modernize the package without introducing any major breaking changes. If, however, something have slipped through 137 unit tests we have, please let me know. I hope you will like it.
❗️ = breaking change
renderInteractiveForms propFixed rendering glitches on certain browsers & graphic cards (#1010).
Brought back pageIndex and pageNumber in customTextRenderer args that, despite undocumented, may have been used by some (#1190).
pageIndex and pageNumber in customTextRenderer args that, despite undocumented, may have been used by some (#1190).typeof window checks with typeof document checks to avoid Deno environment being falsely recognized as browser environment.onItemClick callback working only once per item (#997, #1192).Added support for devicePixelRatio prop in Page component.
devicePixelRatio prop in Page component.itemIndex to the customTextRenderer (#1183). Thanks, @paescuj!Fixed text items misaligned when using customTextRenderer and if textContent items have both text and line break (#1173).
customTextRenderer and if textContent items have both text and line break (#1173).Improved text selection behavior (#1034).
Fixed customTextRenderer called too often and potentially with undefined str (#1151).
customTextRenderer called too often and potentially with undefined str (#1151).Fixed Vite specific entry causing fake worker to be initialized (#1148).
Fixed Vite specific entry causing build to fail (#1148).
Added a note on SVG mode deprecation.
See Upgrade guide from version 5.x to 6.x.
Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.
❗️ = breaking change
onRenderTextLayerError and onRenderTextLayerSuccessonRenderTextLayerError proponRenderTextLayerSuccess prop.onGetTextSuccess is now called with an object containing items and styles.TextLayer.css now must be imported manually for TextLayer to work properly.customTextRenderer (#1124).file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!merge-class-names with clsx.renderInteractiveForms prop ignored. Thanks, @liquidautumn!Replaced merge-class-names with clsx.
merge-class-names with clsx.@babel/runtime.".Added official support for Vite.
❗️ = breaking change
@babel/runtime.customTextRenderer (#1124).Added a note on SVG mode deprecation.
onRenderTextLayerError and onRenderTextLayerSuccessenhanceTextSelection prop. This was previously implemented in 6.0.0-beta, but later found deprecated in PDF.js.renderInteractiveForms prop ignored. Thanks, @liquidautumn!file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!
file-loader is now an optional peerDependency (#970). Thanks, @rpaasche!Improved documentation on Preact compatibility.
See Upgrade guide from version 5.x to 6.x.
See Upgrade guide from version 5.x to 6.x.
Note: React <16.8 is not supported. If you're still using React older than 16.8, please use react-pdf@^5.0.0 instead.
❗️ = breaking change
enhanceTextSelection prop.onRenderTextLayerError prop.onRenderTextLayerSuccess prop.onGetTextSuccess is now called with an object containing items and styles.TextLayer.css now must be imported manually for TextLayer to work properly.Added instructions on support for standard fonts.
canvas rendering mode (default) when using React 18 w. StrictMode on (#972).Replaced deprecated renderInteractiveForms option with annotationMode in page.render call (#946).
renderInteractiveForms option with annotationMode in page.render call (#946).workerPort instead of workerSrc in Parcel 2 specific entry (#941). Thanks, @jamesjessian!Added official support for Parcel 2.
Biggest one in months!
worker-loader, which turned out to be quite problematic in the past. Don't worry, if you want to stick to the old Webpack-specific one, it should still work just fine!externalLinkRel prop.dest and pageIndex to onItemClick callbacks (#812, #924). Thanks, @malwilley!pdf.worker.js.Your coding agent can read these notes before it upgrades. Set up the MCP server →