compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

[Web App] How can I add display markup text

Open antranvn opened this issue 3 years ago • 1 comments

Hello guys, how can I display markup text? Can we use tag or inline style for innerHTML?

antranvn avatar Dec 28 '21 07:12 antranvn

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?

koyakei avatar Jun 22 '24 10:06 koyakei

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 14:07 okushnikov