androidx.compose.material3

TopAppBarColors

Class

No hand-written docs yet.

Represents the colors used by a top app bar in different states. This implementation animates the container color according to the top app bar scroll state. It does not animate the leading, headline, or trailing colors.

class TopAppBarColors(
    containerColor: Color,
    scrolledContainerColor: Color,
    navigationIconContentColor: Color,
    titleContentColor: Color,
    actionIconContentColor: Color,
    subtitleContentColor: Color,
)

How to get one

Create it

Ready-made values and functions that return it

Used by

Parameters that take a TopAppBarColors.

Properties

containerColor

val containerColor: Color

scrolledContainerColor

val scrolledContainerColor: Color
val navigationIconContentColor: Color

titleContentColor

val titleContentColor: Color

actionIconContentColor

val actionIconContentColor: Color

subtitleContentColorSince 1.9

val subtitleContentColor: Color

Functions

copy

fun copy(
    containerColor: Color = this.containerColor,
    scrolledContainerColor: Color = this.scrolledContainerColor,
    navigationIconContentColor: Color = this.navigationIconContentColor,
    titleContentColor: Color = this.titleContentColor,
    actionIconContentColor: Color = this.actionIconContentColor,
    subtitleContentColor: Color = this.subtitleContentColor,
): TopAppBarColors

Returns a copy of this TopAppBarColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”

Library docs

Represents the colors used by a top app bar in different states. This implementation animates the container color according to the top app bar scroll state. It does not animate the leading, headline, or trailing colors.