Introduction
PDF document creation is stuck in the past, from clunky Word docs to complex LaTeX to outdated tools. htmldocs brings document generation into 2025 with a modern developer experience using React, TypeScript, and Tailwind.
Key Features
- π Support for the latest CSS features like margin boxes and flexbox
- 𧩠Collection of unstyled components for document layout
- π JSX templating system for building dynamic documents
- π Full TypeScript support for type safety
- β‘ Dynamic data integration through props and APIs
- π Real-time preview server with hot reloading
Example
To see htmldocs in action, hereβs a simple example of a dynamic invoice template:
Creating multiple invoices is as simple as passing different customer information through props. Hereβs how you can generate a new invoice by updating the customer details:
Automatic Installation
Use the CLI tool to quickly set up htmldocs in your project with minimal configuration.
Manual Installation
Integrate htmldocs step-by-step into your existing TypeScript project.
Components
htmldocs comes with a set of standardized components that makes it easy to build documents.
Document
The root wrapper component representing a document.
Page
A single page within a document.
Head
Add custom content to the top of your document pages.
Spacer
Add vertical space between document pages.
MarginBox
Position content in the margins of printed pages.
Footer
Add page numbers and custom footers to your documents.