Styling Text
Fonts, size, weight, and color.
Why Style Text?
In Jetpack Compose, the Text composable shows words on screen. By default it uses a plain look, but you can change its size, color, and weight.
Styling helps users read your app. A title should look bigger and bolder than body text.
You style Text by passing extra parameters to it.
Text("Hello Compose")Making Text Bigger
The fontSize parameter controls how large the text is. Sizes use the sp unit, which scales with the user's font settings.
To use sp, add .sp after a number, like 24.sp.
Text(
text = "Big Title",
fontSize = 24.sp
)