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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@monime/react-pdf-viewer

v0.0.2

Published

A PDF viewer component for React

Readme

React MUI PDF Viewer Example

This example shows how to build a fully‑featured PDF viewer with EmbedPDF, React 18 and Material UI v7. It demonstrates how to combine EmbedPDF’s plugin system with MUI components to create a polished reading experience that feels right at home in any React + MUI project.


Key features on display

| Feature | Plugin(s) | | ---------------------------------------------------------- | ----------------------------------------------------- | | Virtualised scrolling with smooth page rendering | @embedpdf/plugin-scroll + @embedpdf/plugin-render | | Zoom controls (fit page, fit width, marquee zoom, presets) | @embedpdf/plugin-zoom | | Pan/hand tool | @embedpdf/plugin-pan | | Rotate pages | @embedpdf/plugin-rotate | | Single and spread layouts | @embedpdf/plugin-spread | | Thumbnail sidebar | @embedpdf/plugin-thumbnail | | In‑document text search | @embedpdf/plugin-search | | File picker & download | @embedpdf/plugin-loader, @embedpdf/plugin-export | | Fullscreen support | @embedpdf/plugin-fullscreen |

The UI around these plugins is built with MUI’s AppBar, Toolbar, Drawer, Menu, IconButton, and other components. On mobile the side drawers collapse into a bottom sheet for a more native feel.


Quick start

Prerequisites

  • Node 18 or newer
  • pnpm 10 (recommended) or a recent pnpm 8/9
  1. Clone the repo (or your fork) and install dependencies:

    git clone https://github.com/embedpdf/embed-pdf-viewer.git
    cd embed-pdf-viewer
    pnpm install
  2. Build the core packages once so that the example can import them:

    pnpm run build --filter "./packages/*"
    # or keep them rebuilt automatically while you work:
    pnpm watch build --filter "./packages/*"
  3. Run the example dev server:

    pnpm --filter @embedpdf/example-react-mui run dev

    Vite will start on http://localhost:3000 and open the browser automatically.


Building a production bundle

To create an optimized build (under examples/react-mui/dist):

pnpm --filter @embedpdf/example-react-mui run build

The output is a static site you can deploy to any CDN or static host.


Folder layout

examples/react-mui
├── public/           # Static assets (if any)
└── src/
    ├── components/   # MUI‑based UI parts (toolbar, drawers, …)
    ├── hooks/        # Small shared hooks (eg. use‑is‑mobile)
    ├── application.tsx  # Main viewer shell and plugin wiring
    └── main.tsx      # React entry + theming + worker setup

The worker (src/webworker.ts) loads the PDFium WebAssembly bundle from jsDelivr and passes it to EmbedPDF’s WebWorkerEngine.


Customisation tips

  • Swap icons or colours: The UI uses MUI’s sx prop everywhere, so styling tweaks are one line away.
  • Add or remove plugins: Open src/application.tsx and edit the plugins array.

For deep dives check the EmbedPDF documentation and the source of this example.


License

Example code is released under the MIT license, the same as EmbedPDF itself.