Introduction
Copy-paste PDF components for React. Built on Takumi and Forme, works with the shadcn CLI.
pdfcn provides beautifully designed, accessible, and customizable PDF components. Built on Takumi and Forme, and designed to work seamlessly with the shadcn CLI.
Philosophy
pdfcn follows the shadcn model for document generation: copy-paste components you can own, with zero lock-in and sensible defaults that work immediately.
PDF layouts are often treated as one-off templates — assembled with renderer-specific primitives, duplicated styling, and brittle page-break logic. pdfcn takes a different approach. It stays close to each renderer's primitives, keeps the API familiar across Takumi and Forme, and lets you drop down to the underlying renderer whenever you need more control.
The goal is simple: make generated PDFs feel like the rest of your stack — composable, themeable, accessible, and easy to customize.
Why pdfcn?
Most PDF component setups are either too opinionated or too scattered. pdfcn is built for teams that want to ship quickly without giving up control:
- Own Your Code: Copy the components into your project and customize everything.
- Start Fast: Run one command and render your first document with production-ready defaults.
- Choose Your Engine: Use the same component API with Takumi or Forme, then drop to raw renderer APIs when needed.
Two Rendering Bases
Every component and block ships in two implementations:
- Takumi — JSX and Tailwind-style classes rendered to paged, selectable-text PDFs with WebAssembly.
- Forme — React PDF primitives rendered with a page-native layout engine and first-class browser support.
The public props and variants follow pdfcn; only the renderer-specific primitives differ.