androidx.tv.material3

Interfaces

NavigationDrawerScope

NavigationDrawerScope is used to provide the doesNavigationDrawerHaveFocus state to the NavigationDrawerItem composable

ScrollPauseHandle

Handle returned by CarouselState.pauseAutoScroll that can be used to resume auto-scroll.

TabRowScope

TabRowScope is used to provide the doesTabRowHaveFocus state to the Tab composable

Classes

Border

Defines the border for a TV component.

ButtonBorder

Defines Border for all TV Interaction states of Button.

ButtonColors

Defines Colors for all TV Interaction states of Button.

ButtonGlow

Defines Glow for all TV Interaction states of Button.

ButtonScale

Defines the scale for all TV Interaction states of Button.

ButtonShape

Defines Shape for all TV Interaction states of Button.

CardBorder

Represents the Border of Card in different interaction states.

CardColors

Represents the Color of Card in different interaction states.

CardContainerColors

Represents the Color of content in a CardContainer for different interaction states.

CardGlow

Represents the Glow of Card in different interaction states.

CardScale

Represents the scaleFactor of Card in different interaction states.

CardShape

Represents the Shape of Card in different interaction states.

CarouselState

State of the Carousel which allows the user to specify the first item that is shown when the Carousel is instantiated in the constructor.

CheckboxColors

Represents the colors used by the three different sections (checkmark, box, and border) of a Checkbox or TriStateCheckbox in different states.

ClickableChipBorder

Defines Border for all TV Indication states of ClickableChip.

ClickableChipColors

Defines Color for all TV Indication states of ClickableChip.

ClickableChipGlow

Defines Glow for all TV Indication states of ClickableChip.

ClickableChipScale

Defines the scale for all TV states of ClickableChip.

ClickableChipShape

Defines Shape for all TV Indication states of ClickableChip.

ClickableSurfaceBorder

Defines Border for all TV states of Surface.

ClickableSurfaceColors

Defines Color for all TV Interaction states of a Clickable Surface.

ClickableSurfaceGlow

Defines Glow for all TV Interaction states of Surface.

ClickableSurfaceScale

Defines the scale for all TV indication states of Surface.

ClickableSurfaceShape

Defines Shape for all TV Interaction states of a Clickable Surface.

ColorScheme

A color scheme holds all the named color parameters for a MaterialTheme.

DrawerState

State of the NavigationDrawer or ModalNavigationDrawer composable.

Glow

Defines the shadow for a TV component.

ListItemBorder

Represents the Border of ListItem for different interaction states.

ListItemColors

Represents the container & content color Color of ListItem in different interaction states.

ListItemGlow

Represents the Glow of ListItem for different interaction states.

ListItemScale

Represents the scale Float of ListItem for different interaction states.

ListItemShape

Represents the Shape of ListItem in different interaction states.

NavigationDrawerItemBorder

Defines Border for all TV Indication states of a NavigationDrawerItem

NavigationDrawerItemColors

Defines container & content color Color for all TV Indication states of a NavigationDrawerItem

NavigationDrawerItemGlow

Defines Glow for all TV Indication states of a NavigationDrawerItem

NavigationDrawerItemScale

Defines the scale for all TV Indication states of a NavigationDrawerItem

NavigationDrawerItemShape

Defines Shape for all TV Indication states of a NavigationDrawerItem

RadioButtonColors

Represents the color used by a RadioButton in different states.

SelectableChipBorder

Defines Border for all TV Indication states of SelectableChip.

SelectableChipColors

Defines Color for all TV Indication states of SelectableChip.

SelectableChipGlow

Defines Glow for all TV Indication states of SelectableChip.

SelectableChipScale

Defines the scale for all TV states of SelectableChip.

SelectableChipShape

Defines Shape for all TV Indication states of SelectableChip.

SelectableSurfaceBorder

Defines Border for all TV states of a selectable Surface.

SelectableSurfaceColors

Defines Color for all TV Interaction states of a selectable Surface.

SelectableSurfaceGlow

Defines Glow for all TV Interaction states of a selectable Surface.

SelectableSurfaceScale

Defines the scale for all TV Interaction states of selectable Surface.

SelectableSurfaceShape

Defines Shape for all TV Interaction states of a selectable Surface.

Shapes

Material surfaces can be displayed in different shapes.

SurfaceColors

Defines the container & content color Color for a non interactive surface.

SwitchColors

Represents the colors used by a Switch in different states

TabColors

Represents the colors used in a tab in different states.

Typography

The Material Design type scale includes a range of contrasting styles that support the needs of your product and its content.

WideButtonContentColor

Defines Colors for all TV Interaction states of a WideButton

Objects

AssistChipDefaults

Contains the default values used by AssistChip

ButtonDefaults
CardContainerDefaults
CardDefaults

Contains the default values used by all card types.

CarouselDefaults
CheckboxDefaults

Defaults used in Checkbox and TriStateCheckbox.

ClickableSurfaceDefaults

Contains the default values used by clickable Surface.

FilterChipDefaults

Contains the default values used by FilterChip.

IconButtonDefaults
InputChipDefaults

Contains the default values used by InputChip.

ListItemDefaults

Contains the default values used by list items.

MaterialTheme

Contains functions to access the current theme values provided at the call site's position in the hierarchy.

NavigationDrawerItemDefaults

Contains the default values used by selectable NavigationDrawerItem

OutlinedButtonDefaults
OutlinedIconButtonDefaults
RadioButtonDefaults

Defaults used in RadioButton.

SelectableSurfaceDefaults

Contains the default values used by Selectable Surface.

ShapeDefaults

Contains the default values used by Shapes

SuggestionChipDefaults

Contains the default values used by SuggestionChip.

SurfaceDefaults

Contains the default values used by a non-interactive Surface

SwitchDefaults

Contains the default values used by Switch

TabDefaults
TabRowDefaults
WideButtonDefaults

Annotations

Enums

DrawerValue

States that the drawer can exist in.

Composables

AssistChip

Material Design assist chip

Button

Material Design filled button for TV.

Card

Cards contain content and actions that relate information about a subject.

Carousel

Composes a hero card rotator to highlight a piece of content.

Checkbox

Material Design checkbox.

ClassicCard

ClassicCard is an opinionated TV Material card that offers a 4 slot layout to show information about a subject.

CompactCard

CompactCard is an opinionated TV Material card that offers a 4 slot layout to show information about a subject.

DenseListItem

Lists are continuous, vertical indexes of text or images.

FilterChip

Material Design filter chip

Icon

A Material Design icon component that draws bitmap using tint, with a default value of LocalContentColor.

IconButton

Material Design standard icon button for TV.

InputChip

Chips help people enter information, make selections, filter content, or trigger actions.

ListItem

Lists are continuous, vertical indexes of text or images.

MaterialTheme

Material Theming refers to the customization of your Material Design app to better reflect your product’s brand.

ModalNavigationDrawer

Navigation drawers provide ergonomic access to destinations in an app.

NavigationDrawer

Navigation drawers provide ergonomic access to destinations in an app.

NavigationDrawerItem

TV Material Design navigation drawer item.

OutlinedButton

Material Design outlined button for TV.

OutlinedIconButton

Material Design standard icon button for TV.

ProvideTextStyle

This function is used to set the current value of LocalTextStyle, merging the given style with the current style values for any missing attributes.

RadioButton

Material Design radio button.

StandardCardContainer

StandardCardContainer is an opinionated TV Material Card layout with an image and text content to show information about a subject.

SuggestionChip

Material Design suggestion chip

Surface

The Surface is a building block component that will be used for any element on TV such as buttons, cards, navigation, or a simple background etc.

Switch

Material Design Switch.

Tab

Material Design tab.

TabRow

TV-Material Design Horizontal TabRow

Text

High level element that displays text and provides semantics / accessibility information.

TriStateCheckbox

Material Design checkbox parent.

WideButton

Material Design wide button for TV.

WideCardContainer

WideCardContainer is an opinionated TV Material Card layout with an image and text content to show information about a subject.

WideClassicCard

WideClassicCard is an opinionated TV Material card that offers a 4 slot layout to show information about a subject.

contentColorFor

The Material color system contains pairs of colors that are typically used for the background and content color inside a component.

rememberCarouselState

Creates a CarouselState that is remembered across compositions.

rememberDrawerState

Create and remember a DrawerState.

Top-level functions summary

ColorScheme
darkColorScheme(
    primary: Color,
    onPrimary: Color,
    primaryContainer: Color,
    onPrimaryContainer: Color,
    inversePrimary: Color,
    secondary: Color,
    onSecondary: Color,
    secondaryContainer: Color,
    onSecondaryContainer: Color,
    tertiary: Color,
    onTertiary: Color,
    tertiaryContainer: Color,
    onTertiaryContainer: Color,
    background: Color,
    onBackground: Color,
    surface: Color,
    onSurface: Color,
    surfaceVariant: Color,
    onSurfaceVariant: Color,
    surfaceTint: Color,
    inverseSurface: Color,
    inverseOnSurface: Color,
    error: Color,
    onError: Color,
    errorContainer: Color,
    onErrorContainer: Color,
    border: Color,
    borderVariant: Color,
    scrim: Color
)

Returns a dark Material color scheme.

ColorScheme
lightColorScheme(
    primary: Color,
    onPrimary: Color,
    primaryContainer: Color,
    onPrimaryContainer: Color,
    inversePrimary: Color,
    secondary: Color,
    onSecondary: Color,
    secondaryContainer: Color,
    onSecondaryContainer: Color,
    tertiary: Color,
    onTertiary: Color,
    tertiaryContainer: Color,
    onTertiaryContainer: Color,
    background: Color,
    onBackground: Color,
    surface: Color,
    onSurface: Color,
    surfaceVariant: Color,
    onSurfaceVariant: Color,
    surfaceTint: Color,
    inverseSurface: Color,
    inverseOnSurface: Color,
    error: Color,
    onError: Color,
    errorContainer: Color,
    onErrorContainer: Color,
    border: Color,
    borderVariant: Color,
    scrim: Color
)

Returns a light Material color scheme.

Extension functions summary

Color
ColorScheme.contentColorFor(backgroundColor: Color)

The Material color system contains pairs of colors that are typically used for the background and content color inside a component.

Color

Computes the surface tonal color at different elevation levels e.g. surface1 through surface5.

Top-level properties summary

ProvidableCompositionLocal<Color>

CompositionLocal containing the preferred content color for a given position in the hierarchy.

ProvidableCompositionLocal<TextStyle>

CompositionLocal containing the preferred TextStyle that will be used by Text components by default.

Top-level functions

darkColorScheme

fun darkColorScheme(
    primary: Color = ColorDarkTokens.Primary,
    onPrimary: Color = ColorDarkTokens.OnPrimary,
    primaryContainer: Color = ColorDarkTokens.PrimaryContainer,
    onPrimaryContainer: Color = ColorDarkTokens.OnPrimaryContainer,
    inversePrimary: Color = ColorDarkTokens.InversePrimary,
    secondary: Color = ColorDarkTokens.Secondary,
    onSecondary: Color = ColorDarkTokens.OnSecondary,
    secondaryContainer: Color = ColorDarkTokens.SecondaryContainer,
    onSecondaryContainer: Color = ColorDarkTokens.OnSecondaryContainer,
    tertiary: Color = ColorDarkTokens.Tertiary,
    onTertiary: Color = ColorDarkTokens.OnTertiary,
    tertiaryContainer: Color = ColorDarkTokens.TertiaryContainer,
    onTertiaryContainer: Color = ColorDarkTokens.OnTertiaryContainer,
    background: Color = ColorDarkTokens.Background,
    onBackground: Color = ColorDarkTokens.OnBackground,
    surface: Color = ColorDarkTokens.Surface,
    onSurface: Color = ColorDarkTokens.OnSurface,
    surfaceVariant: Color = ColorDarkTokens.SurfaceVariant,
    onSurfaceVariant: Color = ColorDarkTokens.OnSurfaceVariant,
    surfaceTint: Color = primary,
    inverseSurface: Color = ColorDarkTokens.InverseSurface,
    inverseOnSurface: Color = ColorDarkTokens.InverseOnSurface,
    error: Color = ColorDarkTokens.Error,
    onError: Color = ColorDarkTokens.OnError,
    errorContainer: Color = ColorDarkTokens.ErrorContainer,
    onErrorContainer: Color = ColorDarkTokens.OnErrorContainer,
    border: Color = ColorDarkTokens.Border,
    borderVariant: Color = ColorDarkTokens.BorderVariant,
    scrim: Color = ColorDarkTokens.Scrim
): ColorScheme

Returns a dark Material color scheme.

lightColorScheme

fun lightColorScheme(
    primary: Color = ColorLightTokens.Primary,
    onPrimary: Color = ColorLightTokens.OnPrimary,
    primaryContainer: Color = ColorLightTokens.PrimaryContainer,
    onPrimaryContainer: Color = ColorLightTokens.OnPrimaryContainer,
    inversePrimary: Color = ColorLightTokens.InversePrimary,
    secondary: Color = ColorLightTokens.Secondary,
    onSecondary: Color = ColorLightTokens.OnSecondary,
    secondaryContainer: Color = ColorLightTokens.SecondaryContainer,
    onSecondaryContainer: Color = ColorLightTokens.OnSecondaryContainer,
    tertiary: Color = ColorLightTokens.Tertiary,
    onTertiary: Color = ColorLightTokens.OnTertiary,
    tertiaryContainer: Color = ColorLightTokens.TertiaryContainer,
    onTertiaryContainer: Color = ColorLightTokens.OnTertiaryContainer,
    background: Color = ColorLightTokens.Background,
    onBackground: Color = ColorLightTokens.OnBackground,
    surface: Color = ColorLightTokens.Surface,
    onSurface: Color = ColorLightTokens.OnSurface,
    surfaceVariant: Color = ColorLightTokens.SurfaceVariant,
    onSurfaceVariant: Color = ColorLightTokens.OnSurfaceVariant,
    surfaceTint: Color = primary,
    inverseSurface: Color = ColorLightTokens.InverseSurface,
    inverseOnSurface: Color = ColorLightTokens.InverseOnSurface,
    error: Color = ColorLightTokens.Error,
    onError: Color = ColorLightTokens.OnError,
    errorContainer: Color = ColorLightTokens.ErrorContainer,
    onErrorContainer: Color = ColorLightTokens.OnErrorContainer,
    border: Color = ColorLightTokens.Border,
    borderVariant: Color = ColorLightTokens.BorderVariant,
    scrim: Color = ColorLightTokens.Scrim
): ColorScheme

Returns a light Material color scheme.

Extension functions

ColorScheme.contentColorFor

fun ColorScheme.contentColorFor(backgroundColor: Color): Color

The Material color system contains pairs of colors that are typically used for the background and content color inside a component. For example, a Button typically uses primary for its background, and onPrimary for the color of its content (usually text or iconography).

This function tries to match the provided backgroundColor to a 'background' color in this ColorScheme, and then will return the corresponding color used for content. For example, when backgroundColor is ColorScheme.primary, this will return ColorScheme.onPrimary.

If backgroundColor does not match a background color in the theme, this will return Color.Unspecified.

Returns
Color

the matching content color for backgroundColor. If backgroundColor is not present in the theme's ColorScheme, then returns Color.Unspecified.

See also
contentColorFor

ColorScheme.surfaceColorAtElevation

fun ColorScheme.surfaceColorAtElevation(elevation: Dp): Color

Computes the surface tonal color at different elevation levels e.g. surface1 through surface5.

Parameters
elevation: Dp

Elevation value used to compute alpha of the color overlay layer.

Returns
Color

the ColorScheme.surface color with an alpha of the ColorScheme.surfaceTint color overlaid on top of it.

Top-level properties

LocalContentColor

val LocalContentColorProvidableCompositionLocal<Color>

CompositionLocal containing the preferred content color for a given position in the hierarchy. This typically represents the on color for a color in ColorScheme. For example, if the background color is surface, this color is typically set to onSurface.

This color should be used for any typography / iconography, to ensure that the color of these adjusts when the background color changes. For example, on a dark background, text should be light, and on a light background, text should be dark.

Defaults to Color.Black if no color has been explicitly set.

LocalTextStyle

val LocalTextStyleProvidableCompositionLocal<TextStyle>

CompositionLocal containing the preferred TextStyle that will be used by Text components by default. To set the value for this CompositionLocal, see ProvideTextStyle which will merge any missing TextStyle properties with the existing TextStyle set in this CompositionLocal.

See also
ProvideTextStyle