Open-source TypeScript/React library for generating PDFs from JSON templates, with a visual template designer and PDF viewer, running in browser and Node.js.
shadcn-labs/pdfcn
Copy-and-paste React components for generating PDFs, built on Takumi and Forme and designed to work with shadcn/ui.
- Stars
- 3,008
- Forks
- 150
- Open issues
- 54
- Last commit
- 23 days ago
What is it?
pdfcn is a collection of ready-to-use, customizable PDF components for React. Instead of installing a package and configuring a renderer, you copy component source code into your project, in the same way shadcn/ui components are distributed. The components are built on two rendering bases, Takumi and Forme, so a document can be generated from focused React building blocks.
The project offers individual components such as tables, forms and charts, along with larger blocks for documents like invoices and reports. Each component and block has a live preview in the documentation. Setup uses the shadcn-compatible registry format and CLI, so it fits into existing shadcn/ui projects without extra configuration.
The project is MIT licensed and written in TypeScript, with Rust and WebAssembly among its topics for the rendering layer.
Key features
- 01Generate PDFs from React components using either Takumi or Forme as the renderer
- 02Copy component source into your project via the shadcn-compatible CLI
- 03Includes components such as tables, forms and charts
- 04Offers ready-made blocks for invoices, reports and similar documents
- 05Live previews for every component and block in the docs
Use cases
- Adding invoice or receipt generation to a React or Next.js app that already uses shadcn/ui
- Producing business reports with tables and charts as downloadable PDFs
- Building customizable PDF templates whose code you own and can edit directly
Quick start
- 1
Open the installation guide linked in the README
- 2
Browse the components and blocks, then copy the code you need into your React project
In collections
Topics
FAQ
- What is pdfcn?
- Copy-and-paste React components for generating PDFs, built on Takumi and Forme and designed to work with shadcn/ui. pdfcn is a collection of ready-to-use, customizable PDF components for React. Instead of installing a package and configuring a renderer, you copy component source code into your project, in the same way shadcn/ui components are distributed. The components are built on two rendering bases, Takumi and Forme, so a document can be generated from focused React building blocks.
- Is pdfcn free to use? What license does it have?
- pdfcn is open source under the MIT license. Check the license terms before using it in commercial products.
- Is pdfcn still maintained?
- Actively maintained. The last commit to pdfcn was on Oct 15, 2026.
- What can I use pdfcn for?
- Adding invoice or receipt generation to a React or Next.js app that already uses shadcn/ui Producing business reports with tables and charts as downloadable PDFs Building customizable PDF templates whose code you own and can edit directly
- How do I install pdfcn?
- Open the installation guide linked in the README Browse the components and blocks, then copy the code you need into your React project
- Where can I get pdfcn?
- The source code and installation instructions are on GitHub: https://github.com/shadcn-labs/pdfcn
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Go library for generating, editing and signing PDFs, with HTML to PDF conversion, a layout engine, forms, barcodes and PDF/A output.
An HTML to PDF converter for PHP that renders HTML and CSS 2.1 layouts into PDF files without external PDF libraries.
A Docker-based API that converts HTML, URLs, Markdown and Office documents to PDF, and also merges, splits and watermarks PDFs.
Minimal zero-dependency TypeScript library for generating real PDF files with text, rectangles, lines, JPEG images and links.
HTML-to-React parser that converts HTML strings into React elements on both Node.js and the browser.