JetBrains has released Compose Multiplatform 1.12.0, an update to the declarative framework for sharing Kotlin UI code across platforms. Highlights of the new release include a Model Context Protocol (MCP) server for AI agents in Compose Hot Reload, automatic font fallback for the web applications, and a new version of the window and dialog API for desktop apps.
Compose Multiplatform 1.12.0 was unveiled August 26. With the new release, Compose Hot Reload now includes an experimental MCP server that connects AI coding agents to running Compose applications. Using the MCP server, an agent can trigger reloads, take screenshots, inspect the semantic tree, simulate clicks and text input, and read application logs, JetBrains said, allowing it to verify the results of its own edits.
Compose Multiplatform for web now handles characters that the fonts of the application doesn’t cover. When an unresolved character is encountered during rendering, Compose Multiplatform for web downloads the matching Noto font subset and recomposes the affected text. As a result, Japanese, Arabic, Devanagari, and emoji render correctly without developers having to bundle fonts for them, JetBrains said.
Compose Multiplatform 1.12.0 also introduces an experimental version 2 of the API for WindowState
and DialogState
in the androidx.compose.ui.window.v2
package. The new API provides finer control over how windows and dialogs are positioned and sized, allowing developers to select the screen a window appears on, provide custom positioning and sizing logic, set minimum and maximum window sizes, and position dialogs relative to their parent window, JetBrains said.
JetBrains provided two examples of using the API v2. First, developers can use WindowPositionProvider
and WindowSizeProvider
to center a window and give it a fixed size:
val windowState = rememberWindowState(
initialBoundsProvider = WindowBoundsProvider(
positionProvider = WindowPositionProvider.CenteredOnScreen,
sizeProvider = WindowSizeProvider.Fixed(DpSize(400.dp, 200.dp))
)
)
Second, developers can use WindowSizeProvider.Unconstrained
to size a window to its content initially, while allowing that content to expand with fillMaxSize()
when the user enlarges the window:
WindowBoundsProvider(
positionProvider = WindowPositionProvider.CenteredOnScreen,
sizeProvider = WindowSizeProvider.Unconstrained
)
The full release notes for Compose Multiplatform 1.12.0 are available here.