Title Chip is a component used to provide context for associated content, such as a Card.
TitleChipSample
@Composable
fun TitleChipSample() {
TitleChip { Text("Messages") }
}
TitleChipWithCardSample
@Composable
fun TitleChipWithCardSample() {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
TitleChip { Text("Title Chip") }
Spacer(Modifier.height(TitleChipDefaults.associatedContentSpacing))
Card(
title = { Text("Title") },
subtitle = { Text("Subtitle") },
leadingIcon = { Icon(FavoriteIcon, "Localized description") },
) {
Text("Card Content")
}
}
}
TitleChipWithLeadingIconSample
@Composable
fun TitleChipWithLeadingIconSample() {
TitleChip(leadingIcon = { Icon(FavoriteIcon, "Localized description") }) { Text("Messages") }
}