TopAppBar

fun TopAppBar(title: String, modifier: Modifier = Modifier, color: Color = MiuixTheme.colorScheme.surface, titleColor: Color = MiuixTheme.colorScheme.onSurface, largeTitle: String = title, largeTitleColor: Color = MiuixTheme.colorScheme.onSurface, subtitle: String = "", subtitleColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary, navigationIcon: @Composable () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {}, scrollBehavior: ScrollBehavior? = null, defaultWindowInsetsPadding: Boolean = true, titlePadding: Dp = TopAppBarDefaults.TitlePadding, navigationIconPadding: Dp = TopAppBarDefaults.NavigationIconPadding, actionIconPadding: Dp = TopAppBarDefaults.ActionIconPadding, bottomContent: @Composable () -> Unit = {})

A TopAppBar with Miuix style that can collapse and expand based on the scroll position of the content below it.

The TopAppBar can be configured with a title, a navigation icon, and action icons. The large title will collapse when the content is scrolled up and expand when the content is scrolled down.

Parameters

title

The title of the TopAppBar.

modifier

The modifier to be applied to the TopAppBar.

color

The background color of the TopAppBar.

titleColor

The color of the collapsed small title text.

largeTitle

The large title of the TopAppBar.

largeTitleColor

The color of the expanded large title text.

subtitle

The subtitle displayed below the title bar area.

subtitleColor

The color of the subtitle text.

navigationIcon

The Composable content that represents the navigation icon.

actions

The Composable content that represents the action icons.

scrollBehavior

The ScrollBehavior that controls the behavior of the TopAppBar.

defaultWindowInsetsPadding

Whether to apply default window insets padding to the TopAppBar.

titlePadding

The horizontal padding of the TopAppBar's title & large title.

navigationIconPadding

The start padding of the navigation icon.

actionIconPadding

The end padding of the action icons.

bottomContent

The Composable content displayed below the title bar area.