JetpackActionBar

fun JetpackActionBar(@StringRes titleRes: Int, @StringRes actionRes: Int, onActionClick: () -> Unit, onNavigateBackClick: () -> Unit, modifier: Modifier = Modifier, colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors())

A Jetpack Compose top app bar with a title, navigation icon, and action button.

Left-aligned top app bar with a text button instead of an icon for the action. Use when the action needs to be more prominent or when text is clearer than an icon.

Usage Example:

JetpackActionBar(
titleRes = R.string.select_items,
actionRes = R.string.done,
onActionClick = { viewModel.confirmSelection() },
onNavigateBackClick = { navController.navigateUp() }
)

Parameters

titleRes

The string resource ID for the title of the top app bar.

actionRes

The string resource ID for the action button.

onActionClick

The callback when the action button is clicked.

onNavigateBackClick

The callback when the navigation icon is clicked.

modifier

The modifier for this top app bar.

colors

The colors for this top app bar.