Jetpack Compose

Kotlin-based UI framework From Wikipedia, the free encyclopedia

Jetpack Compose is an open-source reactive user interface (UI) framework developed by Google for cross-platform software development in Kotlin. The first preview was announced in May 2019, and the framework was made ready for production in July 2021.

Initial releaseJuly 2021; 4 years ago (2021-07)
Stable release
1.10.6[1] / March 25, 2026; 31 days ago (2026-03-25)
Written inKotlin
Quick facts Developer, Initial release ...
Jetpack Compose
DeveloperGoogle
Initial releaseJuly 2021; 4 years ago (2021-07)
Stable release
1.10.6[1] / March 25, 2026; 31 days ago (2026-03-25)
Written inKotlin
Operating systemAndroid
Available inEnglish
TypeLibrary
LicenseApache
Websitedeveloper.android.com/develop/ui/compose
Repository
Close

In Compose, a user interface is defined using functions that have been annotated with the @Composable annotation, which are known as composable functions and define the screen's state. Jetpack Compose uses a Kotlin compiler plugin to transform composable functions into UI elements.[2] For example, the following code defines a simple UI element:

@Composable
fun Greeting(name: String) {
    Text(text = "Hello $name")
}

History

The first preview of Jetpack Compose was announced at the Google I/O conference in May 2019.[3] The developer preview was released in October 2019,[4] and the alpha release occurred in August 2020.[5]

Compose entered its beta phase in February 2021, with its first production release taking place that July.[6]

Features

Jetpack Compose supports Android 5.0 and later.[7] It uses the Kotlin programming language, and provides a reactive programming model similar to other UI frameworks such as Flutter, Vue.js, and React Native.[3] Compose is designed to integrate seamlessly with existing Android apps and libraries, allowing developers to gradually migrate their apps to Compose.[6]

In Compose, a user interface is defined using functions that have been annotated with the @Composable annotation, which are known as composable functions and define the screen's state.[8][9] The annotation is used by the Compose compiler to generate the UI boilerplate code.[9] When the state is updated, composable functions are called again with new data, which causes the widgets they emit to be redrawn in a process known as recomposition. Recomposition is only performed for composable functions that need to be updated, which improves UI efficiency.[10]

The 1.0 release introduced Compose Preview, which is built into Android Studio starting with Arctic Fox. It allows composables to be previewed using different configurations without deploying the app to a device.[11]

Jetpack Glance is a Jetpack Compose-based framework for developing widgets for Android.[12] Glance's first stable release occurred in September 2023.[13]

In September 2024, the 1.0 stable version of the Jetpack Compose application programming interfaces (APIs) for building adaptive UIs with Material 3 was released.[14]

Use

When Jetpack Compose 1.0 was released, Google said, "There are already over 2,000 apps in the Play Store using Compose – in fact, the Play Store app itself uses Compose."[8] As of October 2022, 16% of the top 1000 apps on the Play Store included Compose. The apps included those from companies such as Airbnb, Lyft, and Square.[15] In May 2024, this number had grown to 40%.[16]

In 2022, Google detailed how it utilized Jetpack Compose as part of its rewrite of the Play Store app, stating that "writing UI requires much less code, sometimes up to 50%" and that the developers were able to improve the app's performance.[17][18] Google rewrote parts of Android's Settings app using Jetpack Compose in Android 14.[19] Meta Platforms developed its Threads social media app in five months using Jetpack Compose.[20][21] The Instagram for Android app has also been written using Jetpack Compose.[22]

Compose Multiplatform

Compose Multiplatform is a multi-platform UI framework developed by JetBrains and based on Jetpack Compose. It is a port of Jetpack Compose for Windows, macOS, Linux, and the web.[23][24][25] Version 1.0 alpha was released in August 2021.[8] iOS support was added in May 2023.[26]

See also

References

Related Articles

Wikiwand AI