Jetpack Compose Basics
A Compose app is made up of composable functions - just regular functions marked with
@Composable
, which can call other composable functions.
A function is all you need to create a new UI component.
A composable function is a regular function annotated with
@Composable
.
Most Compose UI elements such as
Surface
andText
accept an optionalmodifier
parameter. Modifiers tell a UI element how to lay out, display, or behave within its parent layout.
the
padding
modifier will apply an amount of space around the element it decorates. You can create a padding modifier withModifier.padding()
.
There are dozens of modifiers which can be used to align, animate, lay out, make clickable or scrollable, transform, etc.
The three basic standard layout elements in Compose are
Column
,Row
andBox
.