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 this for 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

API Reference