Paul Krill
Editor at Large

Compose Multiplatform brings auto-resizing to interop views

news
Jan 14, 20263 mins

Update of Kotlin-based UI framework enables native interop elements on desktop and iOS to adapt their layout to their content.

JetBrains has released Compose Multiplatform 1.10.0, the latest version of the Kotlin-based declarative framework for building shared UIs across multiple platforms. Unveiled January 13, the update supports automatic resizing for native interop elements on both desktop and iOS deployments.

Resizing of these elements means they now can adapt their layout to their content, eliminating the need to calculate exact sizes manually and specify fixed dimensions in advance. On the desktop,SwingPaneladjusts its size based on the embedded component’s minimum, preferred, and maximum sizes. For iOS, UIKit interop views now support sizing according to the view’s fitting size (intrinsic content size). This enables proper wrapping of SwiftUI views (via UIHostingController) and basic UIView subclasses that do not depend on NSLayoutConstraints.

Instructions on getting started with Compose Multiplatform can be found at kotlang.org. Compose Multiplatform is an optional UI framework built atop Kotlin Multiplatform technology, for building applications for different platforms and reusing code. Compose Multiplatform applications will run on iOS, Android, macOS, Windows, Linux, and the web.

Also in version 1.10.0, Compose Multiplatform now uses the Web Cache API to cache successful responses for static assets and string resources. This avoids the delays associated with the browser’s default cache, which validates stored content through repeated HTTP requests and can be slow on low-bandwidth connections. The cache is cleared on every app launch or page refresh to ensure resources remain consistent with the application’s current state. This capability is an experimental feature.

Other improvements in Compose Multiplatform 1.10.0 include:

  • The Compose Hot Reload plugin now is bundled with the Compose Multiplatform Gradle plugin. Users no longer need to configure the Hot Reload plugin separately, as it is enabled by default for Compose Multiplatform projects targeting desktop.
  • The approach to previews has been unified across platforms. Developers can now use the androidx.compose.ui.tooling.preview.Preview annotation in thecommonMainsource set. Other annotations, such as org.jetbrains.compose.ui.tooling.preview.Previewand the desktop-specific androidx.compose.desktop.ui.tooling.preview.Preview, have been deprecated.
  • Navigation 3, a new library for managing navigation, is now supported on non-Android targets.
  • The following properties inDialogPropertieshave been promoted to stable and are no longer experimental: usePlatformInsets, useSoftwareKeyboardInset, and scrimColor. Similarly, the usePlatformDefaultWidth and usePlatformInsetsproperties in PopupProperties have also been promoted to stable.
  • The deprecation level for Popup overloads without the PopupProperties parameter has been changed to ERROR to enforce the use of the updated API.
  • For iOS, Compose Multiplatform now supports WindowInsetsRulers, which provides functionality to position and size UI elements based on window insets, such as the status bar, navigation bar, or on-screen keyboard.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author