Skip to main content
Forme is a PDF generation library for React and TypeScript. You write JSX components, and Forme renders them to a valid PDF file. There is no headless browser, no Chrome dependency, and no CSS page break hacks. The layout engine runs as a WASM module and produces PDF bytes in milliseconds. Enterprise features include fillable forms, PDF/UA accessibility, PDF/A archival, and digital certification.
Using Svelte? The Svelte adapter ships the same components with the same props — see the Svelte guide.
Want to try it first? Open the playground — no install needed.

1. Install

2. Create a file

Create invoice.tsx:

3. Preview in the browser

Open http://localhost:4242. You will see your invoice rendered as a PDF in the browser with live reload. Edit invoice.tsx and the preview updates instantly. Use the toolbar to toggle debug overlays:
  • Layout mode shows element boundaries
  • Margins mode visualizes spacing
  • Breaks mode marks page break points
Click any element to inspect its computed styles and box model.

4. Build to PDF

This writes a valid PDF file. Open it in any PDF viewer.

5. Use in your app

For programmatic use, call renderDocument() directly:

With dynamic data

Export a function instead of a static element:
Then pass data via the --data flag:

6. Render in the browser

Forme runs entirely client-side too. Import the browser entry point — no server required:
Same engine, same templates. Works with Vite, Next.js, Remix, or any bundler that handles WASM.

Next steps