0PricingLogin
Jetpack Compose Academy · Lesson

Anatomy of an @Composable Function

Read a Composable and spot what makes it special.

What Is a Composable?

A Composable is just a Kotlin function that describes a piece of UI. Call it, and Compose draws that UI on screen. It is the building block of everything. 🧱

The @Composable Annotation

The magic marker is @Composable above the function. It tells the Compose compiler this function can emit UI and may be recomposed when data changes.

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

All lessons in this course

  1. What Compose Replaces: Goodbye XML
  2. Set Up Android Studio for Compose
  3. Anatomy of an @Composable Function
  4. Run Your First App on the Emulator
← Back to Jetpack Compose Academy