Kotlin Help

Get started with Kotlin/Wasm and Compose Multiplatform

This tutorial demonstrates how to run a Compose Multiplatform app with Kotlin/Wasm in IntelliJ IDEA and generate artifacts to publish as part of a website.

Create a project

  1. Set up your environment for Kotlin Multiplatform development.

  2. In IntelliJ IDEA, select File | New | Project.

  3. In the panel on the left, select Kotlin Multiplatform.

  4. Specify the following fields in the New Project window:

    • Name: WasmDemo

    • Group: wasm.project.demo

    • Artifact: wasmdemo

  5. Select the Web target and the Share UI tab. Make sure that no other options are selected.

  6. Click Create.

    Kotlin Multiplatform wizard

Run the application

Once the project loads, select composeApp [wasmJs] in the list of run configurations and click Run.

Run the Compose Multiplatform app on web

The web application opens automatically in your browser. Alternatively, you can open the following URL in your browser when the run is finished:

http://localhost:8080/

Click the "Click me!" button:

Click me

It reveals the Compose Multiplatform logo:

Compose app in browser

Generate artifacts

Generate your project's artifacts to publish on a website:

  1. Open the Gradle tool window by selecting View | Tool Windows | Gradle.

  2. In wasmdemo | Tasks | kotlin browser, select and run the wasmJsBrowserDistribution task.

    Run the Gradle task

    Alternatively, you can run the following command in the terminal from the WasmDemo root directory:

    ./gradlew wasmJsBrowserDistribution

Once the application task completes, you can find the generated artifacts in the composeApp/build/dist/wasmJs/productionExecutable directory:

Artifacts directory

Publish the application

Use the generated artifacts to deploy your Kotlin/Wasm application. Select a publishing option of your preference and follow the instructions to deploy the artifacts. Some alternatives are:

Once your site is created, open the browser and navigate to your platform's page domain. For example, GitHub pages:

Navigate to GitHub pages

Congratulations! You have published your artifacts.

What's next?

10 September 2025