appbar

package
v0.1.119 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 14 Imported by: 0

README

AppBar

@Composable
fun TopAppBar(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    expandedHeight: Dp = TopAppBarDefaults.TopAppBarExpandedHeight,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null,
    contentPadding: PaddingValues = TopAppBarDefaults.ContentPadding
): Unit
@Composable
fun MediumTopAppBar(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    collapsedHeight: Dp = TopAppBarDefaults.MediumAppBarCollapsedHeight,
    expandedHeight: Dp = TopAppBarDefaults.MediumAppBarExpandedHeight,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null
): Unit
@Composable
fun LargeTopAppBar(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    collapsedHeight: Dp = TopAppBarDefaults.LargeAppBarCollapsedHeight,
    expandedHeight: Dp = TopAppBarDefaults.LargeAppBarExpandedHeight,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null
): Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
fun TwoRowsTopAppBar(
    title: @Composable (expanded: Boolean) -> Unit,
    modifier: Modifier = Modifier,
    subtitle: (@Composable (expanded: Boolean) -> Unit)? = null,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    titleHorizontalAlignment: Alignment.Horizontal = Alignment.Start,
    collapsedHeight: Dp = Dp.Unspecified,
    expandedHeight: Dp = Dp.Unspecified,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null
): Unit
@Composable
fun CenterAlignedTopAppBar(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    expandedHeight: Dp = TopAppBarDefaults.TopAppBarExpandedHeight,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null,
    contentPadding: PaddingValues = TopAppBarDefaults.ContentPadding
): Unit

Documentation

Overview

Package appbar contains Material 3 Top App Bar components.

Reference: [Top App Bar](https://m3.material.io/components/top-app-bar/overview) Specs: [Top App Bar Specs](https://m3.material.io/components/top-app-bar/specs)

Index

Constants

This section is empty.

Variables

View Source
var TopAppBarDefaults = topAppBarDefaults{}

TopAppBarDefaults holds the default values for TopAppBar.

Functions

This section is empty.

Types

type Composable

type Composable = api.Composable

func CenterAlignedTopAppBar

func CenterAlignedTopAppBar(
	title Composable,
	options ...TopAppBarOption,
) Composable

CenterAlignedTopAppBar displays information and actions at the top of a screen. The title is centered horizontally.

func LargeTopAppBar

func LargeTopAppBar(
	title Composable,
	options ...TopAppBarOption,
) Composable

LargeTopAppBar displays information and actions at the top of a screen. It has the largest height.

func MediumTopAppBar

func MediumTopAppBar(
	title Composable,
	options ...TopAppBarOption,
) Composable

MediumTopAppBar displays information and actions at the top of a screen. It has a larger height than SmallTopAppBar.

func SingleRowTopAppBar

func SingleRowTopAppBar(
	modifier ui.Modifier,
	title Composable,
	navigationIcon Composable,
	actions []Composable,
	colors TopAppBarColors,
) Composable

SingleRowTopAppBar is an internal component to layout the TopAppBar content in a single row. It is used by SmallTopAppBar and CenterAlignedTopAppBar.

func TopAppBar

func TopAppBar(
	title Composable,
	options ...TopAppBarOption,
) Composable

TopAppBar displays information and actions at the top of a screen. This is equivalent to SmallTopAppBar in Material 3.

func TwoRowsTopAppBar

func TwoRowsTopAppBar(
	modifier ui.Modifier,
	title Composable,
	titleBottomPadding int,
	maxHeight int,
	navigationIcon Composable,
	actions []Composable,
	colors TopAppBarColors,
) Composable

TwoRowsTopAppBar is an internal component to layout Medium and Large TopAppBars.

type Composer

type Composer = api.Composer

type TopAppBarColors

type TopAppBarColors struct {
	ContainerColor             graphics.Color
	ScrolledContainerColor     graphics.Color
	NavigationIconContentColor graphics.Color
	TitleContentColor          graphics.Color
	ActionIconContentColor     graphics.Color
}

TopAppBarColors represents the colors used by a TopAppBar in different states.

type TopAppBarOption

type TopAppBarOption func(*TopAppBarOptions)

func WithActions

func WithActions(actions ...Composable) TopAppBarOption

func WithColors

func WithColors(colors TopAppBarColors) TopAppBarOption

func WithModifier

func WithModifier(m ui.Modifier) TopAppBarOption

func WithNavigationIcon

func WithNavigationIcon(icon Composable) TopAppBarOption

type TopAppBarOptions

type TopAppBarOptions struct {
	Modifier       ui.Modifier
	NavigationIcon Composable
	Actions        []Composable
	Colors         TopAppBarColors
}

TopAppBarOptions configuration TopAppBarOptions configuration

func DefaultTopAppBarOptions

func DefaultTopAppBarOptions(c Composer) TopAppBarOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL