Jetpack Compose

Jetpack Compose is Android’s modern toolkit for building native user interfaces. Google announced that Compose had reached version 1.0, a stable production-ready release, on July 28, 2021. It replaces the older imperative approach in which a developer inflates a tree of View objects from XML layouts and then mutates those views in code as state changes. With Compose, the UI is instead described declaratively: developers write composable functions that emit UI based on the current application state, and the framework re-renders the affected parts of the screen when that state changes.

The toolkit is written in and for Kotlin and depends on Kotlin language features such as functions and trailing lambdas to express UI hierarchies. A screen is built by calling composable functions from other composable functions, producing a hierarchy of UI elements. Compose provides direct access to Android platform APIs and built-in support for Material Design, dark theme, animations, and adaptive layouts for different screen sizes. The declarative, state-driven model means the developer specifies what the UI should look like for a given state rather than scripting the individual mutations needed to get there.

Compose was developed in the open over roughly two years before the 1.0 release, with feedback and participation from the Android developer community. By the time of the stable launch, Google reported that more than two thousand apps in the Play Store were already using Compose, including the Play Store app itself, which the team cited as evidence that the toolkit was ready for production use. Tooling support was a major part of the release: Android Studio gained Compose-specific features such as live previews and live editing so that UI changes could be seen without a full rebuild.

In the broader history of UI frameworks, Jetpack Compose is the Android counterpart to Apple’s SwiftUI, which Apple had introduced in 2019. Both adopt the same declarative, state-driven paradigm popularized earlier by web frameworks, replacing decades of imperative, view-tree-and-callback UI code on their respective platforms. Compose and SwiftUI are frequently described together as the two big mobile platforms converging on the same model of UI development at roughly the same moment.

Since 1.0, Google has positioned Compose as the recommended way to build Android UI and has continued to ship regular releases adding components, performance improvements, and support for new form factors. It is distributed as part of the Jetpack family of Android libraries and is built and consumed through the same Android SDK and Gradle build pipeline as the rest of an Android project. In this library Jetpack Compose sits at the meeting point of the Android platform and the Kotlin language, and is best understood alongside SwiftUI as a parallel development in mobile UI history.