0PricingLogin
Jetpack Compose Academy · Lesson

Writing a @Composable Function

Define your own reusable UI function.

What You Will Build

In this lesson you will write your own Composable from scratch. By the end, you can describe a piece of UI with a single Kotlin function. 🚀

It Starts With @Composable

A Composable is just a function marked with the @Composable annotation. That tag tells Compose this function emits UI instead of returning a value.

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

All lessons in this course

  1. Writing a @Composable Function
  2. Live Previews with @Preview
  3. Calling Composables from Composables
  4. setContent: Where Your UI Begins
← Back to Jetpack Compose Academy