StylishTopAppBar

fun StylishTopAppBar(title: @Composable () -> Unit, modifier: Modifier = Modifier, navigationIcon: @Composable () -> Unit? = null, actions: @Composable RowScope.() -> Unit = {}, windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors( containerColor = MaterialTheme.colorScheme.surfaceContainerHigh, scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer, ), scrollBehavior: TopAppBarScrollBehavior? = null, titleContentColor: Color? = null, navigationIconContentColor: Color? = null, actionIconContentColor: Color? = null)

A standard Material 3 top app bar with Stylish theme defaults.

This is the Material-parity app bar for screens that follow the platform convention (edge-to-edge content, scrolling behavior, window insets). It wraps TopAppBar with Stylish container colors: MaterialTheme.colorScheme.surfaceContainerHigh at rest and MaterialTheme.colorScheme.surfaceContainer once content scrolls underneath, driven by scrollBehavior.

The floating pill header remains StylishHeader — use that when you want the Stylish floating silhouette, and this component when you want standard M3 app-bar behavior (e.g. inside the topBar slot of com.segnities007.stylishui.components.patterns.StylishScaffold with a TopAppBarScrollBehavior such as TopAppBarDefaults.enterAlwaysScrollBehavior()).

Parameters

title

The title to be displayed in the top app bar, typically a Text with the screen name.

modifier

Modifier applied to the TopAppBar root.

navigationIcon

Optional composable at the start of the bar, typically an IconButton for back or drawer navigation. When null, no leading content is shown.

actions

Optional composables at the end of the bar, laid out horizontally in a RowScope, typically IconButtons.

windowInsets

WindowInsets that the app bar respects. Defaults to TopAppBarDefaults.windowInsets.

colors

TopAppBarColors for the bar. Defaults to Stylish containers: MaterialTheme.colorScheme.surfaceContainerHigh at rest and MaterialTheme.colorScheme.surfaceContainer when scrolled.

scrollBehavior

A TopAppBarScrollBehavior that changes the bar's height and colors as content scrolls. Typically created via TopAppBarDefaults.enterAlwaysScrollBehavior() or TopAppBarDefaults.pinnedScrollBehavior() and shared with the scrolling content via Modifier.nestedScroll.

titleContentColor

Override for the title content color. When null (default), colors decides the title color.

navigationIconContentColor

Override for the navigation icon color. When null (default), colors decides.

actionIconContentColor

Override for the action icons color. When null (default), colors decides.

See also