The Text Composable
Show a string and control its basics.
The Text Composable is a free Jetpack Compose Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Jetpack Compose Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Meet Text
In Compose, you put words on screen with the Text composable. It is the simplest building block you will use in almost every screen.
Pass a String
Give Text a string and it renders instantly. No XML, no findViewById, just a function call describing what you want shown.
Text("Hello, Compose!")It Is Just a Function
Text is a composable function, not a class you inflate. You call it inside other composables, exactly like calling any Kotlin function. 🙂
Where Text Lives
You write Text inside a composable function such as your screen. Compose reads your code top to bottom and draws each element it finds.
@Composable
fun Greeting() {
Text("Welcome")
}Default Styling
With no extra arguments, Text uses sensible defaults from your theme: a readable size, the on-surface color, and the standard font.
Strings from Resources
For real apps, pull text from stringResource instead of hardcoding. This keeps your app translatable into every language you ship.
Text(stringResource(R.string.greeting))Combine with Variables
Because it is plain Kotlin, you can build the string from variables and templates before passing it to Text. Logic and UI live together.
val name = "Ada"
Text("Hi, " + name)Many Texts, One Screen
Need several lines? Just call Text multiple times. Each call is one independent element you can style on its own later.
maxLines Keeps It Tidy
Long content can be capped with maxLines so a label never grows taller than you expect. It simply stops drawing extra lines.
Text("A very long bio...", maxLines = 1)Reacts to State
When the string you pass changes, Text redraws automatically. You never call an update method; Compose tracks the value for you.
Your First Words
That is the whole idea: describe the text you want, and Compose paints it. Everything fancier is just extra arguments on this same call.
Quick Check
Which line correctly shows a greeting in Compose?
Recap
You met Text, the core composable for showing words. Pass it a string, lean on theme defaults, and it redraws whenever the value changes. 🎉
Frequently asked questions
Is the “The Text Composable” lesson free?
Yes — the full text of “The Text Composable” is free to read here on the web, and the Jetpack Compose Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Jetpack Compose Academy course, upgrade to CoddyKit PRO.
What will I learn in “The Text Composable”?
Show a string and control its basics. You practise Jetpack Compose Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Jetpack Compose Academy?
No prior experience is required. Jetpack Compose Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The Text Composable” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Jetpack Compose Academy lesson?
Yes. Every Jetpack Compose Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.