FluentHtmlBuilder 1.0.2
dotnet add package FluentHtmlBuilder --version 1.0.2
NuGet\Install-Package FluentHtmlBuilder -Version 1.0.2
<PackageReference Include="FluentHtmlBuilder" Version="1.0.2" />
<PackageVersion Include="FluentHtmlBuilder" Version="1.0.2" />
<PackageReference Include="FluentHtmlBuilder" />
paket add FluentHtmlBuilder --version 1.0.2
#r "nuget: FluentHtmlBuilder, 1.0.2"
#addin nuget:?package=FluentHtmlBuilder&version=1.0.2
#tool nuget:?package=FluentHtmlBuilder&version=1.0.2
HtmlBuilder
A lightweight and extensible HTML element builder for .NET developers. Designed with clean and fluent syntax for composing HTML elements dynamically in C# with full support for nesting, attributes, and rendering.
โจ Features
- Dynamic creation of HTML elements via fluent C# API
- Full support for nesting, attributes, and inner content
- Ideal for building reusable HTML components
- Easily extendable with custom rendering logic
- Built with SOLID principles and DDD mindset
๐ฆ Installation
Install the NuGet package:
dotnet add package HtmlBuilder
Or via the NuGet Package Manager:
Install-Package HtmlBuilder
๐ Quick Start
var div = HtmlBuilder.Div(div =>
{
div.Div(x => x.H1(h1 =>
{
h1.SetContent("Hello - World")
.SetId("id")
.AddClass("col-md-4");
}))
.Div(x => x.H2(h2 =>
{
h2.SetContent("GoodBye - World")
.SetId("id")
.AddClass("col-md-3");
}));
});
string html = div.ToPrettyHtml();
Console.WriteLine(html);
Output:
<div>
<div>
<h1 id="id">Hello - World</h1>
</div>
<div>
<h2 id="id">GoodBye - World</h2>
</div>
</div>
๐ Project Structure
HtmlBuilder/
โโโ src/HtmlBuilder/ # Core library
โโโ tests/HtmlBuilder.Tests/ # Unit tests using xUnit
โโโ HtmlBuilder.sln # Solution file
โโโ README.md # This file
๐งช Running Tests
dotnet test
๐ Documentation
Coming soon โ advanced usage and extension patterns will be documented in the Wiki.
๐ค Contributing
Contributions are welcome! Feel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.
๐ License
MIT License
Copyright (c) 2025 DaniyalAsadi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.