Is it possible to integrate compose HTML and compo...
# compose-web
s
Is it possible to integrate compose HTML and compose canvas composables together?
m
Yes, it's possible, create a canvas inside Compose HTML and then in Compose Canvas target that canvas id and you will have both in the same app. You can also share states between the two.
Copy code
fun main() {
    val viewmodel = remember { ViewModel() }
    // compose html code here
    // canvas with id "canvasId"

    // compose canvas code here
    onWasmReady {
        CanvasBasedWindow(
            title = "Title",
            canvasElementId = "canvasId",
        ) {

        }
    }
}
s
Can you position compose html elements inside of or on top of compose html in the same layout hierarchy or do you have to maintain 2 separate layouts entirely?