TopBar

fun TopBar(modifier: Modifier = Modifier, type: TopBarType = TopBarType.DEFAULT, navigationIcon: @Composable () -> Unit, actions: @Composable RowScope.() -> Unit, title: @Composable () -> Unit, colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors())

A composable function that renders a top app bar. Depending on the type, it can display either a default aligned top app bar or a center-aligned top app bar.

Parameters

modifier

The Modifier to be applied to the TopBar.

type

The type of the TopBar, either TopBarType.DEFAULT for a default aligned top app bar or TopBarType.CENTERED for a center-aligned top app bar.

navigationIcon

A composable function that represents the navigation icon displayed in the TopBar, typically a back arrow or a menu icon.

actions

A composable function that represents the actions (e.g., icons, menus) displayed on the right side of the TopBar.

title

A composable function that represents the title content of the TopBar.

colors

A TopAppBarColors that defines the color scheme for the TopBar. Default is TopAppBarDefaults.topAppBarColors.