Jetpack Compose Kotlin Multiplatform

Jetpack Compose vs Kotlin Multiplatform: what's the difference?

They sound like rivals, but they solve completely different problems. One draws your UI. The other shares your code. And when you combine them, you get something even more powerful.

TL;DR

  • Jetpack Compose is a UI toolkit. It's how you build screens on Android.
  • Kotlin Multiplatform (KMP) is a code-sharing technology. It lets you write business logic once and run it on Android, iOS, Desktop, Web and the server.
  • Compose Multiplatform (CMP) is Compose running on top of KMP. It lets you share your UI too.
  • So the real question isn't "Compose or KMP". It's "how much do I want to share?"

If you're an Android developer, you've probably seen these three names thrown around together and wondered whether you need to pick one. You don't. They're layers, not competitors. Let's go through each one, then put them side by side.

Prefer video?See KMP + Compose Multiplatform in action: building Gamopedia

01 What is Jetpack Compose?

Jetpack Compose is Android's modern UI toolkit, built by Google. Instead of writing XML layouts and wiring them up with findViewById, you describe your UI with Kotlin functions. When your state changes, Compose redraws only the parts of the screen that need it.

@Composable
fun GreetingScreen(name: String) {
    var count by remember { mutableStateOf(0) }

    Column(modifier = Modifier.padding(16.dp)) {
        Text("Hello, $name!")
        Button(onClick = { count++ }) {
            Text("Clicked $count times")
        }
    }
}

What Compose handles:

  • Layouts, text, buttons, lists, animations, theming
  • Reacting to state changes and redrawing the UI
  • Navigation between screens (with Navigation Compose)

What Compose doesn't handle on its own:

  • Networking, databases or business rules. That's your ViewModel, repository and data layers.
  • Running on iOS. Jetpack Compose by itself targets Android.

Think of it this way: Compose answers the question "how do I draw this screen?", and nothing more.

02 What is Kotlin Multiplatform?

Kotlin Multiplatform is a technology from JetBrains for sharing Kotlin code across platforms. You write code once in a commonMain source set, and the Kotlin compiler turns it into whatever each platform needs: JVM bytecode for Android and the server, native binaries for iOS, and JavaScript or WebAssembly for the web.

Crucially, KMP is not a UI framework. Out of the box it's about sharing the invisible parts of your app: models, networking, storage, validation and business logic. Each platform can keep its own native UI: Compose on Android, SwiftUI on iOS.

// Written once. Used by Android, iOS, Desktop and even your server.
class GameRepository(
    private val api: GameApi,         // Ktor Client
    private val cache: GameDatabase,  // SQLDelight
) {
    fun games(): Flow<List<Game>> = cache.gameQueries.all().asFlow().mapToList(Dispatchers.IO)

    suspend fun refresh() {
        val fresh = api.fetchGames()
        cache.transaction { fresh.forEach(cache.gameQueries::upsert) }
    }
}

When you need something that only exists on one platform, KMP gives you expect and actual: declare what you need in common code, then provide how on each platform.

expect fun platformName(): String
actual fun platformName(): String =
    "Android ${Build.VERSION.SDK_INT}"
actual fun platformName(): String =
    UIDevice.currentDevice.systemName()

KMP has been stable since late 2023, and Google officially supports it for sharing business logic between Android and iOS. Many Jetpack libraries you already use, like ViewModel, Room and DataStore, now work in common code too.

Think of it this way: KMP answers "how do I avoid writing the same logic twice?"

03 Compose Multiplatform: the bridge between them

This is where most of the confusion comes from. Compose Multiplatform is JetBrains' version of the Compose UI framework that runs on Android, iOS, Desktop and Web. It's built on top of Kotlin Multiplatform, so it uses the same commonMain setup, and it uses the same @Composable APIs you already know from Jetpack Compose.

// The same composable now renders on Android, iPhone and Desktop.
@Composable
fun GameCard(game: Game, onFavorite: () -> Unit) {
    Card(modifier = Modifier.fillMaxWidth()) {
        Row(verticalAlignment = Alignment.CenterVertically) {
            Text(game.name, style = MaterialTheme.typography.titleMedium)
            Spacer(Modifier.weight(1f))
            IconButton(onClick = onFavorite) {
                Icon(Icons.Default.FavoriteBorder, contentDescription = "Favorite")
            }
        }
    }
}

On Android, Compose Multiplatform uses Jetpack Compose under the hood. On other platforms, JetBrains renders the UI with its own engine. iOS support has been stable since 2025, Desktop has been stable for a long time, and Web is still maturing. And you can still drop into SwiftUI or UIKit on iOS for any screen that needs to feel 100% native.

The formula: Kotlin Multiplatform (share logic) + Compose Multiplatform (share UI) = one Kotlin codebase for the whole app.

04 See it visually

Here's what each approach actually shares. Tap a tab to compare.

Android
Compose UI
Business logic
Network & DB
iOS
SwiftUI
Business logic
Network & DB
Desktop
Desktop UI
Business logic
Network & DB

05 Side-by-side comparison

Jetpack ComposeKotlin MultiplatformCompose Multiplatform
What it isUI toolkitCode-sharing technologyCross-platform UI framework
Built byGoogleJetBrains (Google-supported)JetBrains
SharesNothing across platformsLogic, data, networkingUI and logic (with KMP)
PlatformsAndroidAndroid, iOS, Desktop, Web, ServerAndroid, iOS, Desktop, Web
UI on iOSโ€”Native (SwiftUI / UIKit)Shared Compose UI
Key librariesMaterial 3, Navigation, HiltKtor Client, SQLDelight, KoinSame as KMP + Compose UI
Best forAndroid-only appsNative UI with shared logicMaximum code reuse

06 4 common myths

Myth "I have to choose between Compose and KMP."

No. They work at different layers. Most KMP apps use Compose on Android anyway, and Compose Multiplatform is literally Compose on top of KMP.

Myth "KMP means I must share my UI."

Sharing UI is optional. Plenty of teams share only networking and business logic and keep a fully native SwiftUI app on iOS. You decide how much to share, screen by screen.

Myth "I'd have to rewrite my Android app."

You can adopt KMP gradually. Start by moving one module, like your models or API client, into commonMain. Your existing Android app keeps working the whole time.

Myth "Compose Multiplatform is just another Flutter."

Both share UI, but CMP uses Kotlin, compiles to native code, and talks directly to platform APIs. There's no bridge to cross and no new language to learn. Your Android skills transfer almost 1:1.

07 Which one should you use?

Jetpack Compose only

You're building an Android-only app, or you're still learning Android. Master this first. Everything else builds on it.

KMP + native UI

You need iOS, but your iOS team wants fully native SwiftUI, or you're adding KMP to an existing app step by step.

KMP + Compose Multiplatform

You're a small team or solo developer who wants to ship Android, iOS and Desktop from one codebase, fast.

08 The learning path I recommend

  1. Get solid with Jetpack Compose and architecture. State, MVVM, clean layers, DI. These skills carry over to every platform.
  2. Learn KMP fundamentals. Source sets, expect/actual, and multiplatform libraries like Ktor Client, SQLDelight and Koin.
  3. Add Compose Multiplatform. Move your UI into commonMain and run the same app on Android, iOS and Desktop.

Learn it hands-on

Compose Multiplatform: Build Gamopedia

Build a real gaming encyclopedia with KMP, Compose Multiplatform, Koin, Ktor Client and SQLDelight, and run it on Android, iOS and Desktop.

SwiftUI for KMP Developers book cover
Going native on iOS? SwiftUI for KMP Developers Learn SwiftUI side by side with the Jetpack Compose you already know.

Get one practical Kotlin tip every week.

Short, useful, no spam. Plus early access to new courses.