Hey, I'm trying to use kotlinx.html with HTMX, but...
# kotlinx-html
a
Hey, I'm trying to use kotlinx.html with HTMX, but can't use the hx-get, etc property in the DSL.I'm wondering how I could add it myself or import it directly from HTMX?
p
You can easily add it either as a method or variable of htmltag and then use it.
What are you using as serverside framework?
Small example:
Copy code
fun HTMLTag.hxGet(value: String) {
    attributes += "data-hx-get" to value
}

var HTMLTag.hxGet: String
    get() = attributes["data-hx-get"] ?: ""
    set(value) {
        attributes["data-hx-get"] = value
a
Ooo thank you