BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JetBrains Compose Multiplatform Reaches Beta

JetBrains Compose Multiplatform Reaches Beta

This item in japanese

A few months after its announcement as an alpha version, JetBrains Compose Multiplatform has reached beta, which includes many improvements and stabilizes its APIs as a step towards the 1.0 release.

Inspired by Google Jetpack Compose declarative UI framework, Compose Multiplatform aims to extend its approach to multiple platforms. It includes Compose for Desktop and Compose for Web and leverages Kotlin Multiplatform to support a number of different platforms. In particular, Compose Desktop uses Google's Skia library to draw UI widgets on Windows, macOS, and Linux. This provides a unified experience across all supported OSes at the expense of each platform native look and feel.

Given its strict relationship with Kotlin and Jetpack Compose, the main appeal of Compose Multiplatform seems to be with Android developers who might need to support the Web and the Desktop in addition to mobile.

One important change in JetBrains beta is it now refers directly to Google Compose artifacts on the Android platform instead of publishing its own versions. This prevents conflicts such as class duplication and improves compatibility.

Most improvements to Compose Multiplatform beta belong to its desktop version, including improved rendering to extend hardware compatibility, a new mouse pointer API, and accessibility support on macOS.

The software renderer is now used as a fallback renderer in case of issues with the graphics hardware available on the target system. For example, if the rendering system encounters issues with DirectX, it can revert to using OpenGL, and if that also fails, to the software renderer. JetBrains has also improved the performance of the software renderer and added support for non-rectangular views.

The new mouse pointer API has been extended with new events that enable hoverables. This means you can now access the hover state of a composable in a portable way.

Accessibility support for macOS brings the possibility of using VoiceOver for low-vision and blind users and is the first step to make Compose Multiplatform accessible on all OSes, including Windows.

As a last note about new features in the beta, the Web target of Compose Multiplaform now supports SVG graphics. This makes it possible to define and embed vector images into apps using the @Composable API.

To prepare for the 1.0 release, JetBrains has annotated all the APIs that have not received enough feedback or could foreseeably change as experimental. All the APIs that are not experimental may be considered mostly stable, says JetBrains.

At the moment, it is not clear yet if and when JetBrains will support iOS as a target for Compose Multiplatform. It is worth mentioning, though, an independent project aimed to bring Jetpack Compose to the iOS platform, which is still in the experimental stage. In spite of its name being Multiplatform-Compose, it should be not confused with JetBrains Compose Multiplatofrm.

To start with Compose Multiplatform, you can refer to JetBrains tutorials for the desktop and the Web. Another useful reference is the official example app showcase.

Rate this Article

Adoption
Style

BT