HtmlForgeX Documentation
Welcome to the HtmlForgeX documentation. HtmlForgeX is a .NET library that simplifies HTML/CSS/JavaScript generation through a fluent API. It enables creating complex HTML documents, pages, and reports without requiring HTML/CSS/JS knowledge.
Two Libraries, One Philosophy
- HtmlForgeX — Full HTML documents for browsers: dashboards, reports, data visualizations with DataTables, ApexCharts, Tabler UI, maps, and 400+ components
- HtmlForgeX.Email — Email-client-safe HTML with inline styling, 127+ typed components, dark mode support, and Outlook compatibility
- HtmlForgeX.Markdown — Optional OfficeIMO.Markdown bridge and safer markdown rendering that maps into HtmlForgeX elements
- HtmlForgeX.AspNetCore — Embedded asset endpoints, antiforgery helpers, and resumable upload progress wiring for service-hosted pages
Both libraries share the same core principle: you never write HTML, CSS, or JavaScript . Everything is typed C# classes with fluent configuration.
Key Features
- Fluent API — All configuration methods return
thisfor method chaining - Type-safe — Enums for colors, sizes, styles. No magic strings
- Multi-framework — .NET Standard 2.0, .NET Framework 4.7.2, .NET 8.0
- Library modes — Online (CDN), Offline (embedded), OfflineWithFiles
- PowerShell module — Generate reports from PowerShell scripts
- ASP.NET Core integration — Embedded assets, antiforgery, upload progress
- Markdown integration — Prism-ready markdown blocks, tables, task lists, and OfficeIMO mapping
- Native AOT aware — Source-generated JSON and AOT-safe labeling patterns
Quick Example
var doc = new Document();
doc.Body.Page(page => {
page.Table<Employee>(employees, table => {
table.EnableSearch().EnablePaging(25);
});
});
doc.Save("report.html");Documentation Map
- Installation — NuGet packages, PowerShell module
- Quick Start — Build your first document in 5 steps
- Core Concepts — Document, Element, Libraries, Modes
- Tables — DataTables, Bootstrap, Tabler tables
- Charts — ApexCharts, Chart.js with 20+ chart types
- Layout — Containers, grid system, page structure
- Forms — Inputs, selects, form layouts
- Navigation — Tabs, accordion, cards
- Components — Badges, alerts, buttons, icons
- Theming — Dark/light mode, customization
- HtmlForgeX.Email — Email library documentation
- Markdown Rendering —
HtmlForgeX.Markdown, OfficeIMO integration, and safe markdown options - PowerShell — PowerShell module usage
- ASP.NET Core — Web integration
- Embedded Assets & Uploads —
OfflineWithLinks, antiforgery, and upload progress APIs - Advanced — Library modes, performance, AOT, and hosting guidance
- API Reference — Full type and method documentation