Build printable documents with React
Author documents as React components, render them to HTML, and plug that HTML into your PDF pipeline.
Useprint is a React-first toolkit for building printable documents as actual React components.
The docs are a WIP and will be improved upon. This library is a very narrow fork from React Email and optimized for making documents. This library has mostly been used internally, so I apologize if the docs are a bit lackluster, but I have been using the library internally and it has improved our PDF DX tremendously.
The core flow is simple:
- Build your document with
@useprint/components - Preview it locally with
@useprint/cli - Render it to HTML with
@useprint/render - Turn that HTML into a PDF with
useprint-js1 or your own Chromium setup
Start Here
Automatic setup
Run npx init-doc@latest for a ready-made project and preview.
Manual install
Start with @useprint/components and @useprint/cli.
Monorepo setup
Dedicated workspace package with npm workspaces (React Email–style layout).
Your first document
Create a page-aware document as a React component.
Local preview
Preview with the CLI and follow the render-to-PDF pattern in code.
Backends
Useprint focuses on the React-to-HTML layer. Once you have HTML, you can choose how PDFs are produced.
useprint-js
Hosted HTML→PDF flow (coming soon—not on npm yet). Join Discord for updates.
Chromium
Render HTML with Useprint, then drive Chromium or Playwright yourself.
Community
Join the Useprint Discord to ask questions, share what you are building, and follow along with the project.
Why Useprint
- Author documents in React instead of string templates.
- Keep layout logic close to the component tree that produces it.
- Preview documents locally while you iterate.
- Render portable HTML that works with your own PDF backend or
useprint-js1. - Because the PDF path is Chromium-based, you are not limited to a bespoke or partial CSS engine—standard web layout and styling apply.
Footnotes
-
useprint-jsis not publicly available yet but is coming soon. Join the Useprint Discord for updates. ↩ ↩2