0Pricing
Jetpack Compose Academy · Lesson

Text, Outlined & Icon Buttons

Pick the right button variant for the job.

Text, Outlined & Icon Buttons is a free Jetpack Compose Academy lesson on CoddyKit — lesson 2 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.

Buttons Have Personalities

Not every action deserves a bold filled button. Compose offers several button variants, each signaling a different level of emphasis. 🎨

The Filled Button

The standard Button is filled and high-emphasis. It draws the eye, so save it for the one primary action per screen.

Button(onClick = { pay() }) {
    Text("Pay now")
}

OutlinedButton for Secondary

An OutlinedButton has just a border and no fill. It reads as a clear-but-secondary choice sitting next to a filled one.

OutlinedButton(onClick = { cancel() }) {
    Text("Cancel")
}

TextButton for Low Emphasis

A TextButton shows only a label, no border or fill. It is perfect for quiet actions like Learn more or dialog choices.

TextButton(onClick = { dismiss() }) {
    Text("Not now")
}

Emphasis Is a Hierarchy

Think of it as a ladder of emphasis: filled is loudest, outlined is medium, text is quietest. Match the variant to the action's weight.

Icons Inside Buttons

Any button can hold an Icon plus a label in its content row. Add a small spacer so the icon and text do not touch.

Button(onClick = { add() }) {
    Icon(Icons.Default.Add, null)
    Spacer(Modifier.width(8.dp))
    Text("Add")
}

The IconButton

An IconButton is a compact, label-free tap target holding just one icon. It is ideal for toolbars and app-bar actions.

IconButton(onClick = { share() }) {
    Icon(Icons.Default.Share, "Share")
}

Always Describe Your Icon

Give an icon-only button a contentDescription so screen readers can announce it. A null description hides it from accessibility.

IconButton(onClick = { favorite() }) {
    Icon(Icons.Default.Favorite, "Favorite")
}

FilledIconButton for Emphasis

Need an icon button that stands out? FilledIconButton adds a solid background, raising its emphasis above the plain version.

FilledIconButton(onClick = { record() }) {
    Icon(Icons.Default.Mic, "Record")
}

Pick the Right Variant

Choosing well guides users: filled for Confirm, outlined for an alternative, text for dismiss, IconButton for tight spaces.

Same onClick, Different Look

Every variant shares the same onClick contract. You change only the visual weight, never how you wire up the action.

Quick Check

You want a quiet, low-emphasis action with only a label and no border or fill.

Recap: Right Tool, Right Tap

You now have a toolbox: filled Button, OutlinedButton, TextButton, and IconButton. Match emphasis to the action and label your icons. ✨

Frequently asked questions

Is the “Text, Outlined & Icon Buttons” lesson free?

Yes — the full text of “Text, Outlined & Icon Buttons” 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 “Text, Outlined & Icon Buttons”?

Pick the right button variant for the job. 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 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Text, Outlined & Icon Buttons” 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.

All lessons in this course

  1. Button and onClick
  2. Text, Outlined & Icon Buttons
  3. Enabled, Disabled & Loading States
  4. clickable on Any Composable
← Back to Jetpack Compose Academy