Scan your whole stack
From OX Research Newsroom
Are you using @react-pdf/ui?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.1
@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.
| Version | Published | Status |
|---|---|---|
| 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 |
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.
The publisher’s own README, as collected from the registry.
Headless React primitives for building PDF preview and editor interfaces.
The library holds the state and the behaviour. You provide every pixel.
yarn add @react-pdf/ui
react and @react-pdf/renderer are peer dependencies.
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>
);
}
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 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.
| 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.
| 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>.
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.
PlaygroundFile, PlaygroundStatus, PlaygroundError, CopyState,
RenderResult, RootProps and a <Name>ComponentProps type for each
primitive are exported.
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.