State of Compose 2023 results are in! Click here to learn more

← Back to Tv Material

StandardCardLayout

Component
in
Tv Material
. Since 1.0.0-alpha07

Overview

Code Examples

Video

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

It provides a vertical layout with an image card slot at the top. And below that, there are slots for the title, subtitle and description.

@param imageCard defines the Composable to be used for the image card. See CardLayoutDefaults.ImageCard to create an image card. The interactionSource param provided in the lambda function should be forwarded and used with the image card composable. @param title defines the Composable title placed below the image card in the CardLayout. @param modifier the Modifier to be applied to this CardLayout. @param subtitle defines the Composable supporting text placed below the title in CardLayout. @param description defines the Composable description placed below the subtitle in CardLayout. @param contentColor CardLayoutColors defines the content color used in the CardLayout for different interaction states. See CardLayoutDefaults.contentColor. @param interactionSource the MutableInteractionSource representing the stream of Interactions for this CardLayout. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this card layout in different states. This interaction source param would also be forwarded to be used with the imageCard composable.

Overloads

StandardCardLayout

@ExperimentalTvMaterial3Api
@Composable
fun StandardCardLayout(
    imageCard: @Composable (interactionSource: MutableInteractionSource) -> Unit,
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    subtitle: @Composable () -> Unit = {},
    description: @Composable () -> Unit = {},
    contentColor: CardLayoutColors = CardLayoutDefaults.contentColor(),
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)

Parameters

NameDescription
imageCarddefines the Composable to be used for the image card. See CardLayoutDefaults.ImageCard to create an image card. The interactionSource param provided in the lambda function should be forwarded and used with the image card composable.
titledefines the Composable title placed below the image card in the CardLayout.
modifierthe Modifier to be applied to this CardLayout.
subtitledefines the Composable supporting text placed below the title in CardLayout.
descriptiondefines the Composable description placed below the subtitle in CardLayout.
contentColorCardLayoutColors defines the content color used in the CardLayout for different interaction states. See CardLayoutDefaults.contentColor.
interactionSourcethe MutableInteractionSource representing the stream of Interactions for this CardLayout. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this card layout in different states. This interaction source param would also be forwarded to be used with the imageCard composable