Bottom Bars & Floating Action Buttons
Anchor navigation and primary actions.
Bottom Bars & Floating Action Buttons is a free Jetpack Compose Academy lesson on CoddyKit — lesson 3 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.
Anchoring the Bottom
The thumb-friendly zone of a phone is the bottom. Scaffold's bottomBar and floatingActionButton slots put your key controls right where fingers reach. 👍
The bottomBar Slot
Whatever you place in the bottomBar slot is pinned to the bottom, and Scaffold shrinks the content area so nothing slides behind it.
Scaffold(
bottomBar = { BottomAppBar { Text("Tools") } }
) { p -> }BottomAppBar
BottomAppBar is a Material container for actions tied to the current screen, like edit or share buttons. It is a RowScope, so children flow left to right.
Meet the FAB
A FloatingActionButton is the round, raised button for the single most important action on a screen, like Add or Compose. ➕
FloatingActionButton(onClick = { }) {
Icon(Icons.Default.Add, "Add")
}The FAB Slot
Put your FAB in Scaffold's floatingActionButton slot, not in your content. Scaffold then floats it correctly above the bottom edge.
Scaffold(
floatingActionButton = { FloatingActionButton(onClick = {}) {} }
) { p -> }One FAB Per Screen
A FAB signals the primary action, so use just one per screen. Two competing FABs leave users unsure which one really matters.
FAB Position
Control where the FAB sits with floatingActionButtonPosition. The default is the bottom-right corner, but Center pairs nicely with a bottom bar.
floatingActionButtonPosition = FabPosition.CenterFAB Sizes
Beyond the standard FAB, Material 3 adds SmallFloatingActionButton and LargeFloatingActionButton so you can match the button to the screen's weight.
The ExtendedFAB
An ExtendedFloatingActionButton shows an icon plus a text label. It works well when the action's name is not obvious from an icon alone.
ExtendedFloatingActionButton(
onClick = { },
icon = { Icon(Icons.Default.Add, "Add") },
text = { Text("New") }
)Bars and FAB Together
Scaffold understands when a bottomBar and a FAB coexist, lifting the FAB so it never overlaps the bar. You just fill both slots.
Describe the FAB
Like any icon button, give the FAB's Icon a contentDescription. A bare plus sign means nothing to a screen reader without it.
Quick Check
How many FloatingActionButtons should a single screen normally show?
Recap
Use the bottomBar slot for screen actions and the floatingActionButton slot for one primary action. Scaffold spaces them so they never collide. ✨
Frequently asked questions
Is the “Bottom Bars & Floating Action Buttons” lesson free?
Yes — the full text of “Bottom Bars & Floating Action 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 “Bottom Bars & Floating Action Buttons”?
Anchor navigation and primary actions. 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 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Bottom Bars & Floating Action 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
- Scaffold: The Screen Skeleton
- TopAppBar & Action Icons
- Bottom Bars & Floating Action Buttons
- Snackbars & SnackbarHostState