Card

Cards function as a universal container that holds content and actions related to a specific topic.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

Card Preview

Usage

To implement card, you can use this tag Card in the Kotlin file.

    import id.co.biofarma.binduiandroid.components.card.Card
    Card(
        type = "stacked",
        variant = "outline",
        borderSize = "none",
        imageUrl = "https://cdn.britannica.com/20/194520-050-DCAE62F1/New-World-Sylvilagus-cottontail-rabbits.jpg",
        header = {},
        body = {
            Text(
                text = "Rabbit",
                style = Typography.Title.XSmall,
                color = PrimitiveColors.Neutral_900,
                modifier = Modifier.padding(vertical = pxToDp(8f))
            )
            Text(
                text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
                style = Typography.Body.Small,
                color = PrimitiveColors.Neutral_500,
                maxLines = 2,
                overflow = TextOverflow.Ellipsis
            )
        },
        footer = {
            Button(
                text = "DETAIL",
                size = "xs",
                radius = "xs",
                type = "ghost",
                onClick = { Log.d("Card", "Button clicked!") }
            )
            Spacer(modifier = Modifier.padding(8.dp))
            Button(
                text = "SAVE",
                size = "xs",
                radius = "xs",
                onClick = { Log.d("Card", "Button clicked!") }
            )
        }
    )

Example

Variant

Set the variant prop to outline, filled or elevated.

Card Variant

Type

Set the type prop to stacked or horizontal.

Card Type

Radius

Set the borderSize prop to none, xs, sm, md, lg, or xl.

Card Radius


Props

PropsRequiredDefaultTypedescription
idfalse-stringUnique identifier for the component
typefalsestackedstacked horizontalCard content positioned such as stacked and horizontal
varianttrueoutlineoutline filled elevatedThe visual variant style of the card.
borderSizefalse-none xs sm md lg xlCorner radius for card
imageUrlfalse-urlA place for media image
headerfalse-ComposeableA composable function for header content.
bodytrue-ComposeableA composable function for body content.
footerfalse-ComposeableA composable function for footer content.
stylefalse-modifierTo decorate or add behavior to Compose UI elements
BIND © Biofarma Innovate Next-level Design .