Skip to main content

Release 4.6 - Kotlin Extensions with Function Literals with Receiver

· One min read
Miguel Gamboa
HtmlFlow Author

All HTML builders are now available through Kotlin Extensions with function literals with receiver, enabling both nested method and method chaining idioms.

You can write HTML structures in a natural, hierarchical way using nested lambdas, or use method chaining for concise simple sequences:

Nested Method Example
body {
div {
p {
text("Hello")
}
}
}

Both approaches are available depending on your preference - nested lambdas for readability with complex structures, or method chaining for concise simple sequences.