
react-pdf
Create PDF files using React
The Lens
React-pdf lets you build them using JSX components. Instead of wrestling with a PDF library's API, you write `<Document><Page><View><Text>` just like you'd write a React component. The mental model is the same, the output is a PDF.
Everything is free under MIT. No paid tier, no premium features. The library handles layout (flexbox-based), fonts, images, SVG, links, and page breaks. It works in Node.js (server-side generation) and in the browser.
There's nothing to host for the library itself. `npm install @react-pdf/renderer` and start building. If you need server-side PDF generation at scale, you'll run a Node.js service, but that's your infrastructure choice. Solo developers: perfect for adding PDF export to a React app. Invoices, reports, anything you'd otherwise build with a Python PDF library. Small teams: great for any app that needs branded PDF output. The component model makes templates maintainable. Growing teams: it scales, but complex layouts with many pages can be slow to render.
The catch: the flexbox layout engine is close to CSS flexbox but not identical. Some properties behave slightly differently, and you'll spend time debugging layout issues that "should work." Also, rendering speed. Complex multi-page documents can take seconds to generate. For high-volume PDF generation, you might want a dedicated service.
Free vs Self-Hosted vs Paid
fully free### Free Everything. Document creation, flexbox layout, custom fonts, images, SVG, hyphenation, page breaks, bookmarks, annotations, all MIT licensed.
### Self-Hosted (Only Option) Client-side: runs in the browser. No server needed for on-demand PDF generation. Server-side: runs in Node.js. Deploy wherever Node runs: Vercel serverless functions, AWS Lambda, your own server.
### Performance Costs Complex PDFs (50+ pages with images) can take 2-5 seconds to render. In a serverless environment (Lambda, Vercel Functions), that's CPU time you're paying for. Budget ~$0.001-0.01 per PDF generation depending on complexity and provider.
### Cost Comparison - Puppeteer/Playwright HTML-to-PDF: Free but needs a headless browser (~200MB memory) - DocRaptor: $15-125/mo with document limits - react-pdf: $0 with no limits. You provide the compute.
### Verdict Free. Your only cost is the compute time for rendering, which is negligible for most apps.
Completely free. MIT licensed. Your only cost is server compute time for rendering, which is minimal.
Similar Tools
About
- Stars
- 16,507
- Forks
- 1,315
Explore Further
More tools in the directory
Get tools like this delivered weekly
The Open Source Drop — the best new open source tools, analyzed. Free.

