react-pdf

A React-based renderer that creates PDF documents from JSON specifications. It uses React PDF to define document structure such as pages, headings, tables, and invoice content.

In plain words
What is it for?
Use it to create PDFs from JSON for documents such as invoices, reports, and other pages with headings, tables, and formatted content.
Why use it?
It lets applications generate documents from structured data instead of manually assembling PDF files. The result can be produced in memory, as a stream, or as a saved file.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/vercel-labs/json-render/react-pdf
Any agent
npx skills add vercel-labs/json-render --skill react-pdf
Clone the repo
git clone --depth 1 https://github.com/vercel-labs/json-render

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 945 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00945
Opus 5 $0.00019 $0.00473
Sonnet 5 $0.00008 $0.00189
Haiku 4.5 $0.00004 $0.00094

Measured 2d ago against content hash 8e94db1ea2ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-pdf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/react-pdf/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

@json-render/react-pdf

React PDF renderer that generates PDF documents from JSON specs using @react-pdf/renderer.

Installation

npm install @json-render/core @json-render/react-pdf

Quick Start

import { renderToBuffer } from "@json-render/react-pdf";
import type { Spec } from "@json-render/core";

const spec: Spec = {
  root: "doc",
  elements: {
    doc: { type: "Document", props: { title: "Invoice" }, children: ["page"] },
    page: {
      type: "Page",
      props: { size: "A4" },
      children: ["heading", "table"],
    },
    heading: {
      type: "Heading",
      props: { text: "Invoice #1234", level: "h1" },
      children: [],
    },
    table: {
      type: "Table",
      props: {
        columns: [
          { header: "Item", width: "60%" },
          { header: "Price", width: "40%", align: "right" },
        ],
        rows: [
          ["Widget A", "$10.00"],
          ["Widget B", "$25.00"],
        ],
      },
      children: [],
    },
  },
};

const buffer = await renderToBuffer(spec);

Render APIs

import { renderToBuffer, renderToStream, renderToFile } from "@json-render/react-pdf";

// In-memory buffer
const buffer = await renderToBuffer(spec);

// Readable stream (pipe to HTTP response)
const stream = await renderToStream(spec);
stream.pipe(res);

// Direct to file
await renderToFile(spec, "./output.pdf");

All render functions accept an optional second argument: { registry?, state?, handlers? }.

Standard Components

Component Description
Document Top-level PDF wrapper (must be root)
Page Page with size (A4, LETTER), orientation, margins
View Generic container (padding, margin, background, border)
Row, Column Flex layout with gap, align, justify
Heading h1-h4 heading text
Text Body text (fontSize, color, weight, alignment)
Image Image from URL or base64
Link Hyperlink with text and href
Table Data table with typed columns and rows
List Ordered or unordered list
Divider Horizontal line separator
Spacer Empty vertical space
PageNumber Current page number and total pages

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 145 lines · 39 tokens per session scan A 8e94db1ea2ba

Subscribe to this mod's changes

react-pdf is a skill published in the GitHub repository vercel-labs/json-render (16,056 stars, last pushed 4d ago), licensed Apache-2.0. It adds 39 tokens to every session and 945 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and…

agentscope-ai/QwenPaw · 92 tokens

foundry-hosted-agent-validation

Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.

microsoft/agent-framework · 82 tokens

gpu-document-processing

Use when processing large PDFs, document collections, or bulk text extraction tasks that benefit from GPU-accelerated processing. Triggers when the user provides large documents or needs bulk document analysis.

langchain-ai/deepagents · 41 tokens

n8n-binary-and-data

Handle files and binary data in n8n correctly. Use when working with files, images, PDFs, attachments, uploads or downloads, base64, vision/multimodal input, or when an AI agent needs a file as tool input or output — and whenever the user mentions $binary, binaryPropertyName, "read the PDF", "attach the file", "send…

czlonkowski/n8n-mcp · 135 tokens

format-specific-extraction

Format-specific document extraction workflows.

xberg-io/xberg · 10 tokens

paper-spine

Build, rewrite, audit, submit, revise, or transfer scholarly papers end to end, producing verified LaTeX/PDF/Word and target-specific publication packages.

WUBING2023/PaperSpine · 37 tokens