Compose allows creating desktop applications for macOS, Linux, and Windows.
On this page
Introduction
Compose has a desktop-only API: Desktop-only API
This API provides access to desktop-specific features, such as window management, system tray integration, file dialogs, and more.
Top-level windows
Compose offers various functions for managing windows. You can hide them in the tray, make them draggable, adapt their size, change their position, etc.
Scrollbars
You can apply scrollbars to scrollable components. The scrollbar and scrollable components share a common state to synchronize with each other.
Tooltips
You can add tooltips to any composable. A tooltip is a small pop-up window that displays a brief description of the component when the user hovers over it with the mouse pointer.
Context menus
You can add context menus to any composable. A context menu is a pop-up menu that appears when the user right-clicks on a component.
Mouse events
In your desktop project, you can listen to various mouse events, like clicking, moving, scrolling, or entering and exiting the input region.
Keyboard events
You can manage keyboard events by setting up event handlers in two different scopes:
- Event handlers based on the focused element.
- Event handlers in the window scope.
Accessibility support
Compose Multiplatform make most accessibility features available in common code across all platforms.
Testing UI with JUnit
Compose Multiplatform for desktop provides a testing API based on JUnit and the Jetpack Compose testing API.
Native distribution
All available tasks are shown in the Gradle tool window.

In the composeApp\build.gradle.kts file is the application configuration unit:
compose.desktop { application { mainClass = "dev.xtec.desktop.MainKt"
nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "Desktop" packageVersion = "1.0.0" windows { console = true perUserInstall = true } } }}You can see that we have modified the application configuration with Platform-specific options for Windows.
Generate an installation package for Windows:
.\gradlew packageMsi...> Task :composeApp:packageMsiThe distribution is written to C:\Users\david\Workspace\desktop\composeApp\build\compose\binaries\main\msi\dev.xtec.desktop-1.0.0.msiAfter running a task, Gradle generates the output binaries in the ${project.buildDir}/compose/binaries directory.
Install the application:

ProGuard
ProGuard is an open-source tool for code shrinking and obfuscation.
You can run the application with the same configuration as a distribution (with ProGuard):
.\gradlew runReleaseTODO We have an error Unsupported version number [66.0] (maximum 62.65535, Java 18). Does ProGuard only work with Java 17 to 18?
For each packaging task, the Gradle plugin provides a “release” task (with ProGuard).
> .\gradlew packageReleaseMsiOr let Gradle select automatically depending on the operating system:
> .\gradlew packageDistributionForCurrentOS