OCIllustrationCard Composable
The OCIllustrationCard
Composable is a component used in Android Jetpack Compose for creating illustration
cards.
The Illustration Card is supposed to give teaser information about a topic.
Usage
To use the OCIllustrationCard
Composable in your Compose project, you need to call it within your
Composable hierarchy.
@Composable
fun OCIllustrationCardPreview() {
OCTheme {
OCIllustrationCard(
title = "Title",
description = "Description text goes here.",
buttonText = "Button",
imageComposable = {
Image(
painter = painterResource(id = R.drawable.placeholder),
contentDescription = null
)
},
cardBackgroundColor = Blue,
onButtonClick = {
// handle button click here
}
)
}
}
Parameters:
title
: title of illustration card.
description
: description of illustration card.
buttonText
: text of the button showing in the illustration card.
cardBackgroundColor
: it is used to set card background color
imageComposable
: it is used to set image showing in the card