Jetpack Compose is Google's modern declarative UI toolkit for Android that transforms how developers build native interfaces using pure Kotlin code instead of XML layouts. As the production standard for Android development β and declared Compose-first by Google in May 2026 β Compose enables reactive UIs where changes to state automatically trigger recomposition, updating only the necessary parts of the screen. The composable function paradigm (marked with @Composable) treats UI components as functions of state, making interfaces predictable, testable, and significantly easier to maintain. Understanding recomposition, state management, and modifier chains is essential β these concepts form the foundation of every Compose application and directly impact both developer productivity and runtime performance. The current stable BOM is 2026.04.01 (Compose 1.11).
What This Cheat Sheet Covers
This topic spans 25 focused tables and 198 indexed concepts, 180 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Composable Fundamentals
The composable function model and recomposition lifecycle are the core mental models every Compose developer must internalize first β everything else builds on these foundations.
| Concept | Example | Description | |
|---|---|---|---|
fun Greeting(name: String) { Text("Hello $name")} | β’ Marks a function as composable, enabling it to emit UI and participate in recomposition β’ can only be called from other composable functions or composition contexts. | ||
var count by remember { mutableStateOf(0) }Text("Count: $count") | β’ Process where Compose re-executes composables when state changes β’ skips stable composables whose inputs haven't changed for performance. | ||
val scrollState = rememberScrollState() | β’ Caches a value across recompositions β’ value is lost on configuration changes like rotation β use rememberSaveable for persistence. | ||
var text by remember { mutableStateOf("") } | β’ Creates an observable state holder β’ changes to the value trigger recomposition of composables reading it. | ||
var input by rememberSaveable { mutableStateOf("") } | Like remember but survives configuration changes and process death by serializing values to a Bundle. | ||
TextField(value = text, onValueChange = { text = it }) | β’ Pattern of moving state up to a caller to make composables stateless and reusable β’ state lives in parent, child receives value and callbacks. | ||
var count by remember { mutableIntStateOf(0) } | Optimized observable state for Int values β avoids boxing overhead compared to mutableStateOf<Int>(0). | ||
key(item.id) { ItemRow(item)} | β’ Provides stable identity to composables β’ essential in lists to preserve state and avoid UI bugs when items reorder. | ||
setContent { MyApp()} | β’ Initial process where Compose builds the UI tree by executing composables β’ happens once when the app starts or when entering a composition scope. | ||
Composition β Layout β Drawing | β’ Three-phase rendering: Composition (what to show), Layout (where to place), Drawing (how to render) β’ understanding phases is critical for performance. | ||
Automatic with stable inputs | Compose skips recomposition of a composable if all its parameters are equal to the previous composition, dramatically improving performance. |