Jetpack Compose Tutorial #4: Text, Button, Image, and TextField — Core Components

You know layouts. You know modifiers. Now let’s learn the components you will use in every single screen — Text, Button, Image, and TextField. These are the building blocks of every Android app. Get comfortable with them and you can build almost anything. Text — Showing Words on Screen You have already used Text, but there is much more to it. Basic Text Text("Hello, World!") Styling Text Text( text = "Styled Text", fontSize = 24.sp, fontWeight = FontWeight.Bold, color = Color.Blue, letterSpacing = 1.sp, textAlign = TextAlign.Center, modifier = Modifier.fillMaxWidth() ) All the Style Options Property What It Does Example fontSize Text size 16.sp, 24.sp fontWeight Thickness FontWeight.Bold, FontWeight.Light fontStyle Italic or normal FontStyle.Italic color Text color Color.Red, Color(0xFF333333) textAlign Alignment TextAlign.Center, TextAlign.End letterSpacing Space between letters 2.sp lineHeight Space between lines 28.sp maxLines Maximum number of lines 1, 3 overflow What happens when text is too long TextOverflow.Ellipsis textDecoration Underline or strikethrough TextDecoration.Underline Truncating Long Text When text is too long for the available space: ...

March 16, 2026 · 9 min