AppTopBar

fun AppTopBar(modifier: Modifier = Modifier, title: String? = null, subtitle: String? = null, onBack: () -> Unit? = null, onClose: () -> Unit? = null, onFavorite: () -> Unit? = null, onMenuClick: () -> Unit? = null, onSearchClick: () -> Unit? = null, backgroundColor: Color = Color.Unspecified, useTransparent: Boolean = false, scrollBehavior: TopAppBarScrollBehavior? = null, profileImageSource: AppImageSource? = null, onProfileClick: () -> Unit? = null)

A custom TopAppBar that can switch between a default and a transparent style. It supports a title, subtitle, back button, close button, favorite button, menu button, and actions.

Parameters

modifier

The Modifier to be applied to the top bar.

title

The title text to be displayed.

subtitle

The subtitle text to be displayed below the title.

onBack

Callback for the back navigation icon.

onClose

Callback for the close navigation icon.

onFavorite

Callback for the favorite action icon.

onMenuClick

Callback for the menu navigation icon.

onSearchClick

Callback when the search icon is clicked.

backgroundColor

The background color used for contrast in transparent mode.

useTransparent

Whether to use the transparent style.

scrollBehavior
profileImageSource

The source of the profile image (URL or Resource).

onProfileClick

Callback when the profile image is clicked.


fun AppTopBar(config: TopBarConfig, modifier: Modifier = Modifier, scrollBehavior: TopAppBarScrollBehavior? = null)

A custom TopAppBar that uses a TopBarConfig to determine its state.

Parameters

config

The TopBarConfig to use.

modifier

The Modifier to be applied to the top bar.

scrollBehavior

fun AppTopBar(configs: List<TopBarConfig>, selectedRoute: String, modifier: Modifier = Modifier, scrollBehavior: TopAppBarScrollBehavior? = null)

A custom TopAppBar that selects the appropriate configuration from a list based on the selected route.

Parameters

configs

The list of TopBarConfig to choose from.

selectedRoute

The currently selected route.

modifier

The Modifier to be applied to the top bar.

scrollBehavior