Compose Multiplatform🎯 Deep Dive📚 Part 1/4

Setting Up Compose Multiplatform: From Zero to Hello World

September 21, 202515 min read

Everything you need to know to start building cross-platform apps with Compose Multiplatform. We'll cover project setup, dependencies, and build your first shared UI that runs on both iOS and Android.

Introduction

Jetpack Compose isn't just for Android anymore. With Compose Multiplatform (CMP), you can write one UI codebase in Kotlin and run it across Android, iOS, and Desktop. In this first part of the series, we'll set up a CMP project using JetBrains' Kotlin Multiplatform Wizard and get it running on Desktop.

Step 1: Generate the Project

Go to Kotlin Multiplatform Wizard.

Select:

  • ✅ Android
  • ✅ iOS
  • ✅ Desktop
  • ✅ iOS UI = Compose
  • ✅ Include Tests

Click "New Project", download, and open it in IntelliJ IDEA.

Your project will look like this:

Project Structuretext
shared/
  └── src/
      ├── commonMain/   # shared UI + logic
      ├── androidMain/  # Android-specific
      ├── iosMain/      # iOS-specific
      └── desktopMain/  # Desktop-specific

Step 2: Run on Desktop

In desktopMain/kotlin/Main.kt you'll find:

Main.ktkotlin
1fun main() = application {
2 Window(onCloseRequest = ::exitApplication) {
3 Text("Hello, Compose Multiplatform!")
4 }
5}

Quick Tip: Select Desktop run config in IntelliJ.

▶ Run → Your first CMP app opens in a native window.

Ready for More? In Part 2, we'll start building a real app UI and share it across platforms.