0Pricing
Android Academy · Lesson

What a Composable Is

Functions that describe UI.

What Is a Composable?

In Jetpack Compose you build screens by writing functions, not by inflating XML layouts. A composable is just a Kotlin function that describes a piece of your user interface.

You mark such a function with the @Composable annotation. That tells the Compose compiler this function can emit UI and can call other composable functions.

The @Composable Annotation

Adding @Composable above a function unlocks Compose's superpowers. Inside it, you can call other composables like Text or Column.

By convention, composable function names start with an uppercase letter, just like classes. This makes UI functions easy to spot in your code.

@Composable
fun Greeting() {
    Text("Hello, Compose!")
}

All lessons in this course

  1. What a Composable Is
  2. Text and Column Basics
  3. Previewing Your UI
  4. Building a Profile Card
← Back to Android Academy