npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pdfrx/react

v0.27.0

Published

React components and hooks for the pdfrx canvas-based PDF viewer

Readme

@pdfrx/react

React components and hooks for the pdfrx_web canvas viewer. Start with the all-in-one PdfrxViewerApp, compose the supplied UI pieces, or build custom UI with headless hooks.

npm package · Live demo · API reference · Detailed guide

Highlights

  • The all-in-one viewer includes toolbar, responsive thumbnails/outline sidebar, search, forms, annotations, page editing, print, and download.
  • The same functionality is available as composable components and headless hooks, so applications can own as much of the UI as they need.
  • Annotation, form, and page changes share one chronological Undo/Redo history.
  • PDF and image opening, thumbnail insertion/reordering, and image annotation drops are supported by the standard UI.
  • Two-page book layouts, rectangular image capture, marquee zoom, and browser fullscreen are available as composed controls; the all-in-one app keeps the specialized layout/capture tools and printing hidden until explicitly enabled.
  • Declarative feature groups and effective PDF permissions consistently hide or disable standard print, page-editing, annotation, and form entry points.
  • English, Japanese, Simplified and Traditional Chinese, French, and German are built in, with string overrides for additional locales.
  • CSS custom properties provide theming and responsive behavior; server rendering and React StrictMode are supported.
  • Application overrides can retain the standard chrome while replacing open, page mutation, and export operations.

Install

npm install @pdfrx/react react react-dom

Minimal usage

import { PdfrxViewerApp } from '@pdfrx/react';
import '@pdfrx/react/styles.css';

export function App() {
  return (
    <PdfrxViewerApp
      src="/manual.pdf"
      wasmModulesUrl="/pdfium/"
      style={{ height: '100dvh' }}
    />
  );
}

Copy pdfium_worker.js and pdfium.wasm from node_modules/@pdfrx/engine/assets/ into the public /pdfium/ directory. Remote PDF URLs must allow browser CORS access.

Browser printing is supported on desktop platforms. On iOS/iPadOS the standard print button is omitted because WebKit cannot reliably isolate PDF pages from the surrounding viewer UI; use the save/download action instead.

Transparent embedding

The canvas background and the all-in-one app background are separate layers. To reveal the embedding application's background through PdfrxViewerApp, make both transparent:

<PdfrxViewerApp
  src="/manual.pdf"
  wasmModulesUrl="/pdfium/"
  backgroundColor="transparent"
  style={{ height: '100dvh', background: 'transparent' }}
/>

backgroundColor="transparent" clears the viewer canvas around PDF pages. The inline background override removes the default var(--pdfrx-bg) fill on the .pdfrx-app wrapper; omitting it reveals that themed wrapper background, not the application behind it.

Choose an integration level

Next steps

License

MIT