Introduction
htmldocs is a modern typesetting toolkit that lets you build document templates using React and JSX - the same way you build web applications. Create reusable components, use props for dynamic content, and leverage the entire JavaScript ecosystem:
With htmldocs, you can:
- Build document templates using React components and JSX syntax
- Use your favorite JavaScript libraries - from date formatting to charting
- Style documents with modern CSS and frameworks like Tailwind
- Generate professional-quality PDFs at scale with precise typesetting
- Preview changes in real-time with hot-reloading as you develop
- Share components and styles across your documents for consistent branding
- Version control your templates just like you do with code
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.