Introducing Compose Multiplatform
While Jetpack Compose is the new UI toolkit on Android, its underlying ideas and principles make it attractive for other platforms, too. Let’s see why this is the case:
- The declarative approach was first implemented on the web
- SwiftUI, Apple’s implementation of a declarative UI framework, works well for iPhones, iPads, watches, and macOS devices
- Jetpack Compose UI elements use Material Design, which is designed for different platforms, device categories, and form factors
Most importantly, core concepts such as state and composable functions are not Android-specific. Therefore, if someone provides the toolchain (for example, the Kotlin compiler and the Compose compiler), any platform capable of showing graphics may be able to execute Compose apps. Certainly, there is an awful lot of work to be done.
For example, the Compose UI must be hosted somewhere. On Android, activities are used. On the web, this would be...