TextOverlayCard

fun TextOverlayCard(title: String, modifier: Modifier = Modifier, label: String? = null, addon: TextOverlayAddon = TextOverlayAddon.None, mediaContainer: TextOverlayMediaContainer, titleSize: TextOverlayTitleSize = TextOverlayTitleSize.Large, showArrow: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onClick: () -> Unit)(source)

The Text Overlay Card is a component that displays simple content and serves as an entry point to other pages containing more detailed information.

Parameters

title

Typically a short title or headline for the card.

modifier

The modifier to be applied to the card.

label

An optional label that can be displayed above the title.

addon

Additional content to be displayed on the card, such as a badge or commercial message.

mediaContainer

The media container that holds the image content for the card.

titleSize

The size of the title text, which can be either Large, Medium, or Small.

showArrow

A boolean indicating whether to show an arrow icon on the card, typically used to indicate that the card is clickable or leads to more content.

interactionSource

The interaction source that will be used to handle interactions with the card, such as focus and hover states.

onClick

A lambda function that will be called when the card is clicked. This is where you can define the action to take when the card is interacted with.

See also

Samples

val context = LocalContext.current
val title = "Classic pieces with a modern twist but with sixty characters"

Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
    TextOverlayCard(
        title = title,
        modifier = Modifier.fillMaxWidth(),
        addon = TextOverlayAddon.Badge(variant = BadgeVariant.Text(label = "New card", size = BadgeSize.Small), color = BadgeColor.Green),
        mediaContainer = TextOverlayMediaContainer.Image(painter = painterResource(R.drawable.ic_avatar_person), contentDescription = ""),
        titleSize = TextOverlayTitleSize.Medium,
        showArrow = true,
        onClick = {
            Toast.makeText(context, "TextOverlayCard clicked", Toast.LENGTH_SHORT).show()
        }
    )
}