JetBrains, the creator of Kotlin, released the first technology preview of Jetpack Compose for Web. As you may already know, this comes after the company’s successful launch of Jetpack Compose for Desktop late last year. It’s likely to make Android app development even more cross-platform compatible.
“While we keep actively developing Compose for Desktop toward its 1.0 release, this is the next chapter in our multiplatform story for Jetpack Compose,” JetBrains’s Sebastian Aigner wrote in a blog post that announced the release. Jetpack’s new avatar brings Google’s toolkit for building reactive user interfaces with Kotlin to the web. For Kotlin app development enthusiasts, this would be a significant addition in terms of coding experiences.
Top Features of Jetpack Compose for Web
From exciting multiplatform functionalities to composable APIs and more, Compose for Web offers a glamorous array of features.
Kotlin Multiplatform Capabilities
Jetpack Compose for Web is built on top of the Kotlin Multiplatform framework. That means Android developers can use the platform to build Android, Desktop, and web applications. Besides, the multiplatform framework enables you to share platform-agnostic code and functionality like you share business logic. At the same time, you could use platform-specific functionality from the JavaScript, Android, and Desktop JVM ecosystems.
Jetpack Compose for Web’s first preview also enables you to freely reuse core Compose state management concepts across platforms. Besides, you can also use the except/actual mechanism of the Kotlin Multiplatform framework. Using this method, you can apply the same coding principle to build an app UI on mobile, desktop, and web alike.
Composable DOM API
JetBrains, with this new release, offers two types of APIs that it’s currently using for the Compose platform. These include a DOM API and a web implementation of the widgets used in Android app development and Jetpack Compose for Desktop.
Using the composable DOM API, you can get full control over the Document Object Model. Jetpack Compose for Web will also offer a type-safe DSL for style sheets. You can use this capability to express CSS rules in your Kotlin app development project. And that’s not all. You can even modify styles based on the state of your Compose application.
Multiplatform Widgets
For multiplatform widgets, JetBrains is experimenting with a set of new layouts, widgets, and APIs that mimic features of Jetpack Compose for Desktop and Android. These layouts try to approximate the behavior of Jetpack Compose’s canvas-based implementations. They create a look and feel of the components built on the DOM. You can copy-paste an implementation of the Jetpack Compose UI into the Compose for Web.
Wrapping up
If you’re an Android developer, go ahead and test the waters with Jetpack Compose for Web! JetBrains has provided installation instructions for the new Compose. You could also share your use case, ideas, or other feedback with JetBrains.
At Android Developer, we’re already testing this for building feature-rich web solutions. If you’re a business owner, you could hire Android app developers to make flawless multiplatform mobile apps. If you’re an Android enthusiast, keeping following our blogs and social media posts to stay updated.
Frequently Asked Questions
Q. How much does it cost to build a Kotlin-based Android app?
The costs of developing a Kotlin-based Android app depend on several factors. Design complexity, development time, type of features, etc. play a key role in calculating the costs. We develop feature-rich Kotlin-based apps at a competitive price.
Q. What is Jetpack Compose for Desktop?
Jetpack Compose for Desktop is Android’s modern toolkit for building native user interfaces. It simplifies UI development for Android app developers. Compose enables you to quickly build an app with less code, powerful tools, and Kotlin APIs.
Q. What is native mobile app development?
Native mobile apps are built in a specific programming language, for the specific device platform, either iOS or Android. Native Android apps are written in Java or Kotlin programming languages.