Attributes Builder
DSL for building attributes.
Data attributes can be set using the attributes builder:
fun Html.Counter() {
val count = signal(0)
button(
onClick = { count.value++ },
data = { "is-even" with count { it % 2 == 0 } } // Sets the data-is-even attribute
) {
text(count { "Count: $it" })
}
}Content copied to clipboard
Since
0.2.0