Compose Hot Reload
Compose Hot Reload helps you visualize and experiment with UI changes while working on a Compose Multiplatform project.
The bundled Compose Hot Reload Gradle plugin requires Kotlin 2.1.20+ and a JVM target compatible with Java 21 or earlier.
While we explore adding support for other targets, you can already use the desktop app as your sandbox to quickly experiment with UI changes in common code without interrupting your flow.

Add Compose Hot Reload to your project
Compose Hot Reload can be added in two ways, by:
From scratch
This section walks you through the steps to create a multiplatform project with a desktop target in IntelliJ IDEA and Android Studio. When your project is created, Compose Hot Reload is automatically added.
In the quickstart, complete the instructions to set up your environment for Kotlin Multiplatform development.
In IntelliJ IDEA, select File | New | Project.
In the panel on the left, select Kotlin Multiplatform.
Specify the Name, Group, and Artifact fields in the New Project window
Select the Desktop target and click Create.

To an existing project
Starting with Compose Multiplatform 1.10.0, the Compose Hot Reload plugin is bundled and enabled by default for all projects that include a desktop target.
If your project already includes a desktop target, you can upgrade to Compose Multiplatform version 1.10.0 or later and enjoy Compose Hot Reload functionality out-of-the-box.
While it is enabled by default, you can still explicitly declare the Compose Hot Reload plugin to use a specific older version.
Earlier versions of Compose Multiplatform
For multiplatform projects using a Compose Multiplatform version earlier than 1.10.0, you must have a desktop target configured and then explicitly add the Compose Hot Reload plugin. The steps refer to the project from the Create an app with shared logic and UI tutorial as a reference.
Introduce the desktop target: create the
jvmMaindirectory, define amain()function, and provide theactualimplementations. If your project already includes a desktop target, you can skip this step. For reference, see the sample in Add a JVM entry point.Update the version catalog with the latest version of Compose Hot Reload (see Releases). In
gradle/libs.versions.toml, add the following code:composeHotReload = { id = "org.jetbrains.compose.hot-reload", version.ref = "composeHotReload"}In the
build.gradle.ktsof your parent project (ComposeDemo/build.gradle.kts), add the following code to yourplugins {}block:plugins { alias(libs.plugins.composeHotReload) apply false }This prevents the Compose Hot Reload plugin from being loaded multiple times in each of your subprojects.
In the
build.gradle.ktsof the subproject containing your multiplatform application (ComposeDemo/composeApp/build.gradle.kts), add the following code to yourplugins {}block:plugins { alias(libs.plugins.composeHotReload) }To use the full functionality of Compose Hot Reload, your project must run on JetBrains Runtime (JBR), an OpenJDK fork that supports enhanced class redefinition. Compose Hot Reload can automatically provision a compatible JBR for your project.
To allow automatic provisioning, add the following Gradle plugin to your
settings.gradle.ktsfile:plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" }Click the Sync Gradle Changes button to synchronize Gradle files:

Use Compose Hot Reload
In the
jvmMaindirectory, open themain.ktfile and update themain()function:fun main() = application { Window( onCloseRequest = ::exitApplication, alwaysOnTop = true, title = "composedemo", ) { App() } }By setting the
alwaysOnTopvariable totrue, the generated desktop app stays on top of all your windows, making it easier to edit your code and see changes live.Open the
App.ktfile and update theButtoncomposable:Button(onClick = { showContent = !showContent }) { Column { Text(Greeting().greet()) } }Now, the text for the button is controlled by the
greet()function.Open the
Greeting.ktfile and update thegreet()function:fun greet(): String { return "Hello!" }Open the
main.ktfile and click the Run icon in the gutter. Select Run 'composeApp [jvm]' with Compose Hot Reload.

Update the string returned from the
greet()function, then save all files (⌘ S/Ctrl+S) to see the desktop app update automatically.
Congratulations! You've seen Compose Hot Reload in action. Now you can experiment with changing text, images, formatting, UI structure, and more, without having to restart the desktop run configuration after every change.
Get help
If you encounter any problems using Compose Hot Reload, let us know by creating a GitHub issue.
