+
diff --git a/compose/mpp/demo/src/jsMain/resources/styles.css b/compose/mpp/demo/src/jsMain/resources/styles.css
new file mode 100644
index 0000000000000..27450e30c4fce
--- /dev/null
+++ b/compose/mpp/demo/src/jsMain/resources/styles.css
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+html, body {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+}
+
+h1 {
+ padding: 0 16px;
+ font-size: 2em;
+}
+
+#composeApplication {
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/compose/mpp/demo/src/wasmJsMain/kotlin/androidx/compose/mpp/demo/main.js.kt b/compose/mpp/demo/src/wasmJsMain/kotlin/androidx/compose/mpp/demo/main.js.kt
index 6add8dbe5f8f0..10cd97a47dfa6 100644
--- a/compose/mpp/demo/src/wasmJsMain/kotlin/androidx/compose/mpp/demo/main.js.kt
+++ b/compose/mpp/demo/src/wasmJsMain/kotlin/androidx/compose/mpp/demo/main.js.kt
@@ -19,11 +19,11 @@ package androidx.compose.mpp.demo
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.ExperimentalComposeUiApi
-import androidx.compose.ui.window.CanvasBasedWindow
+import androidx.compose.ui.window.ComposeViewport
@OptIn(ExperimentalComposeUiApi::class)
fun main() {
- CanvasBasedWindow("Compose/JS sample", canvasElementId = "canvas1") {
+ ComposeViewport(viewportContainer = "composeApplication") {
val app = remember { App() }
app.Content()
}
diff --git a/compose/mpp/demo/src/wasmJsMain/resources/index.html b/compose/mpp/demo/src/wasmJsMain/resources/index.html
index ad01c1e78435e..5435963290971 100644
--- a/compose/mpp/demo/src/wasmJsMain/resources/index.html
+++ b/compose/mpp/demo/src/wasmJsMain/resources/index.html
@@ -1,5 +1,5 @@