Join Slack
Communities
Powered by
And on the side, since Compose Multiplatform has n...
# feed
s
Sargun Vohra
01/01/2025, 2:13 AM
And on the side, since Compose Multiplatform has no HTML interop built in, I published a little library that adds an HtmlElement composable, like AndroidView or SwingPanel or UIKitView. You can use it to interop Compose UI with non-compose UI, like embedding maps or videos. I’ve only tested on JS but published for both JS and Wasm. Source code:
https://github.com/sargunv/maplibre-compose/tree/main/lib/compose-html-interop
Maven:
https://central.sonatype.com/artifact/dev.sargunv.maplibre-compose/compose-html-interop
Example usage:
https://github.com/sargunv/maplibre-compose/blob/18ce6feba4b1ed86fa53130e8ac79c3e1[…]jsMain/kotlin/dev/sargunv/maplibrecompose/compose/WebMapView.kt
There’s no docs, but the example above should cover it. It has caveats: it can either display on top of the Compose canvas or below it with a transparent window in Compose. If on top, it’ll cover any Compose UI elements that should’ve rendered on top (just like SwingPanel). If below, it’ll render under Compose overlays just fine, but won’t be able to capture pointer input (as the Compose canvas will block it).
🧵 1
👏 2
2
Views
Open in Slack
Previous
Next