compose-multiplatform
compose-multiplatform copied to clipboard
[Web App] How can I add display markup text
Hello guys, how can I display markup text? Can we use tag or inline style for innerHTML?
import androidx.compose.runtime.*
import org.jetbrains.compose.web.dom.*
import org.jetbrains.compose.web.renderComposable
import kotlinx.browser.document
import org.w3c.dom.HTMLElement
fun main() {
renderComposable(rootElementId = "content") {
Div {
Button(attrs = {
onClick {
val contentDiv = document.getElementById("content") as HTMLElement
contentDiv.innerHTML = "<h1>Hello, Compose Multiplatform!</h1><p>This is an example of using innerHTML.</p>"
}
}) {
Text("Click me")
}
}
}
}
https://www.perplexity.ai/search/Directorybased-routing-routing-lm.u0tF8TPCcx4ErH33k3w#2 Is it ok?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.