Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@react-pdf/ui

Latest version: v1.0.1

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: diegomura
16,863 Stars
1,353 Forks
3 Versions
91 Downloads
TypeScript Repo language

Scan summary

@react-pdf/ui was last scanned on 24 Nov 2026 at version 1.0.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions; the latest was published on 24 Nov 2026.
  • Findings: No rules fired in version 1.0.1.
  • Downloads: 91 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.1 LATEST 24 Nov 2026 No rules fired
1.0.0 27 Aug 2026 No rules fired
0.1.0 27 Aug 2026 No rules fired

No rules fired in 1.0.1

Findings

Findings for v1.0.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@react-pdf/ui

Headless React primitives for building PDF preview and editor interfaces.

The library holds the state and the behaviour. You provide every pixel.

Install

yarn add @react-pdf/ui

react and @react-pdf/renderer are peer dependencies.

Usage

Every primitive takes a Component prop and renders it with state and handlers. It renders no DOM of its own, and className and style are forwarded to your component untouched.

import { Playground } from '@react-pdf/ui';

const files = [
  {
    name: 'index.jsx',
    code: `ReactPDF.render(
  <Document>
    <Page><Text>Hello</Text></Page>
  </Document>
);`,
  },
];

function Editor() {
  return (
    <Playground files={files}>
      <Playground.Files Component={FileTabs} />
      <Playground.Editor Component={CodeMirrorEditor} />
      <Playground.Document Component={PdfCanvas} />
      <Playground.Pagination Component={Pager} />
      <Playground.DownloadButton Component={Button} />
    </Playground>
  );
}

What it does and does not do

It owns file state, transpiling and evaluating the source, render orchestration (debounce, abort on supersede, keeping the last good document when a render fails), object URL lifecycle, status and error, page state and clamping, the copy state machine and the download trigger.

It does not rasterise PDF pages, so it does not depend on pdfjs-dist. Your Document component decides how a page is painted and how large it is.

Rendering

Rendering is built in. Sources are transpiled with sucrase and evaluated, and the resulting document is rendered to a Blob on the main thread, which costs 4-25ms for typical documents.

The evaluated code must hand the library a document:

ReactPDF.render(<MyDocument />);

Inside that code, React, ReactPDF and every @react-pdf/renderer export are in scope as globals, and import/require of react and @react-pdf/renderer resolve. @react-pdf/math and @react-pdf/mermaid are optional peers, loaded lazily the first time an example imports one. Nothing else resolves; there is no module resolution between files either, so files are concatenated in array order and a declaration has to appear before the file that uses it.

Examples share one renderer instance, so Font.register families persist for the session. Hyphenation and emoji callbacks are reset before every render. See docs/web-workers.md for why that is not worth a worker by default.

Root

Prop Type Default
files { name, code }[] required
id string none
onFilesChange (files) => void none
onActiveFileChange (name) => void none
filename string 'document.pdf'

The first render fires immediately; edits are debounced by a fixed 250ms. State is uncontrolled: files seeds it, onFilesChange observes it, and changing id resets everything. The file set itself is fixed; only file contents change.

Primitives

Primitive Props passed to Component
Playground.Files files, activeFile, onSelect
Playground.Editor value, onChange, fileName, error
Playground.Document url, blob, page, numPages, rendering, error
Playground.Pagination page, numPages, canPrevious, canNext, onPrevious, onNext, onSelect
Playground.Status status, error
Playground.CopyButton onPress, state
Playground.DownloadButton onPress, href, filename, disabled

numPages comes from the rendered document's own layout, so Playground.Pagination is correct without your Document component reporting anything back.

Playground.Editor renders null when there is no active file.

Playground.CopyButton copies the active file's source; state goes back to 'idle' 1.5s after a copy.

Playground.DownloadButton provides both handles, so <a href download> works as well as <button onClick>.

Errors

A render failure reaches Playground.Status, Playground.Document and Playground.Editor as an Error. Syntax errors carry a line; everything else is the error the evaluated code threw, untouched, because attributing it to a file or a position is guesswork once files are concatenated.

A failed render keeps the last good document on screen, so a preview does not blank out on a typo.

Types

PlaygroundFile, PlaygroundStatus, PlaygroundError, CopyState, RenderResult, RootProps and a <Name>ComponentProps type for each primitive are exported.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @react-pdf/ui

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229