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
- Writing a @Composable Function
- Live Previews with @Preview
- Calling Composables from Composables
- setContent: Where Your UI Begins