FluentHtml follows a layered architecture that integrates seamlessly with ASP.NET Core:
Browser → HTTP Request → ASP.NET Core Pipeline → Minimal API Route → FluentHtml Components → Rendering Engine → HTML Response → Browser
Node
├── Element (single HTML tag: Div, Span, Button, Form, Table, Input...)
├── TextNode (plain text, always HTML encoded)
├── RawHtml (trusted HTML, not encoded - use sparingly)
├── Fragment (groups multiple sibling nodes without wrapper element)
└── Component (reusable UI, composes existing nodes)
Component Tree → Normalize → Render → Encode → HTML
| Aspect | Elements | Components |
|---|---|---|
| Represents | HTML tags | Application UI |
| Renders | Exactly one HTML tag | May render many elements |
| Example | Button → <button> |
CustomerCard → Card, Image, Heading |
A component may:
A component should NOT:
Every configuration method returns the current object for method chaining:
Button("Save")
.Primary()
.Large()
.HxPost("/users")
.Target("#content")