androidx.compose.material3

BottomAppBar

Composable function

A bottom app bar holds actions for the current screen, at the bottom where thumbs reach easily. Put it in the bottomBar slot of a Scaffold.

For switching between destinations, use a NavigationBar instead.

Actions and a FAB
Actions and a FAB
BottomAppBar(
    actions = {
        IconButton(onClick = {}) { Icon(Icons.Filled.Check, "Mark done") }
        IconButton(onClick = {}) { Icon(Icons.Filled.Edit, "Edit") }
        IconButton(onClick = {}) { Icon(Icons.Filled.Search, "Search") }
    },
    floatingActionButton = {
        FloatingActionButton(
            onClick = {},
            elevation = FloatingActionButtonDefaults.bottomAppBarFabElevation(),
        ) { Icon(Icons.Filled.Add, "Add") }
    },
    modifier = Modifier.width(360.dp),
)

Actions and FAB

Icon buttons on the start, a FAB on the end.

@Composable
fun BottomAppBar(
    actions: @Composable RowScope.() -> Unit,
    modifier: Modifier = Modifier,
    floatingActionButton: @Composable (() -> Unit)? = null,
    containerColor: Color = BottomAppBarDefaults.containerColor,
    contentColor: Color = contentColorFor(containerColor),
    tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
    contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
    windowInsets: WindowInsets = BottomAppBarDefaults.windowInsets,
)

actions: @Composable RowScope.() -> UnitRequired

Icon buttons at the start of the bar. Placed in a Row.

modifier: ModifierOptional

Default: Modifier

Changes size, padding, or position. See the Modifier guide.

floatingActionButton: @Composable (() -> Unit)?Optional

Default: null

A FAB at the end of the bar. Give it FloatingActionButtonDefaults.bottomAppBarFabElevation() so it does not float.

containerColor: ColorOptional

Default: BottomAppBarDefaults.containerColor

The background color.

contentColor: ColorOptional

Default: contentColorFor(containerColor)

The default color for icons inside.

tonalElevation: DpOptional

Default: BottomAppBarDefaults.ContainerElevation

Tints the background a little toward the primary color.

contentPadding: PaddingValuesOptional

Default: BottomAppBarDefaults.ContentPadding

Space between the edge of the bar and its content.

windowInsets: WindowInsetsOptional

Default: BottomAppBarDefaults.windowInsets

Space kept free for system bars, like the gesture bar on phones. The default is usually right.

Actions and FAB, hides on scrollExperimental

Adds scrollBehavior.

@Composable
fun BottomAppBar(
    actions: @Composable RowScope.() -> Unit,
    modifier: Modifier = Modifier,
    floatingActionButton: @Composable (() -> Unit)? = null,
    containerColor: Color = BottomAppBarDefaults.containerColor,
    contentColor: Color = contentColorFor(containerColor),
    tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
    contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
    windowInsets: WindowInsets = BottomAppBarDefaults.windowInsets,
    scrollBehavior: BottomAppBarScrollBehavior? = null,
)

scrollBehavior: BottomAppBarScrollBehavior?Optional

Default: null

Hides the bar when the user scrolls down. Get one from BottomAppBarDefaults.exitAlwaysScrollBehavior(). Also add Modifier.nestedScroll(scrollBehavior.nestedScrollConnection) to the Scaffold.

Same as above: actions, modifier, floatingActionButton, containerColor, contentColor, tonalElevation, contentPadding, windowInsets.

Custom content

You place everything.

@Composable
fun BottomAppBar(
    modifier: Modifier = Modifier,
    containerColor: Color = BottomAppBarDefaults.containerColor,
    contentColor: Color = contentColorFor(containerColor),
    tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
    contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
    windowInsets: WindowInsets = BottomAppBarDefaults.windowInsets,
    content: @Composable RowScope.() -> Unit,
)

content: @Composable RowScope.() -> UnitRequired

Everything inside the bar, in a Row.

Same as above: modifier, containerColor, contentColor, tonalElevation, contentPadding, windowInsets.

Custom content, hides on scrollExperimental

Adds scrollBehavior.

@Composable
fun BottomAppBar(
    modifier: Modifier = Modifier,
    containerColor: Color = BottomAppBarDefaults.containerColor,
    contentColor: Color = contentColorFor(containerColor),
    tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
    contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
    windowInsets: WindowInsets = BottomAppBarDefaults.windowInsets,
    scrollBehavior: BottomAppBarScrollBehavior? = null,
    content: @Composable RowScope.() -> Unit,
)

Same as above: modifier, containerColor, contentColor, tonalElevation, contentPadding, windowInsets, scrollBehavior, content.

Bottom app bar types

See also