JengaCard

fun JengaCard(modifier: Modifier = Modifier, variant: JengaCardVariant = JengaCardVariant.Elevated, onClick: () -> Unit? = null, enabled: Boolean = true, selected: Boolean = false, shape: Shape = JengaCardDefaults.shape, colors: JengaCardColors = JengaCardDefaults.colors(variant, selected), elevation: Dp = JengaCardDefaults.elevation(variant), contentPadding: PaddingValues = JengaTheme.components.card?.contentPadding ?: JengaCardDefaults.contentPadding, borderWidth: Dp = if (selected) { JengaCardDefaults.SelectedBorderWidth } else { JengaTheme.components.card?.borderWidth ?: JengaCardDefaults.BorderWidth }, disabledAlpha: Float = JengaTheme.components.card?.disabledAlpha ?: JengaCardDefaults.DisabledAlpha, content: @Composable ColumnScope.() -> Unit)(source)

A surface that groups related content.

Parameters

modifier

the Modifier for this card.

variant

the visual style; see JengaCardVariant.

onClick

optional click handler; when set, the card becomes focusable and clickable with a ripple.

enabled

when false, the card is drawn at disabledAlpha, onClick is ignored and the card is reported as disabled to accessibility services.

selected

whether the card is the chosen one; draws a brand border of JengaCardDefaults.SelectedBorderWidth and reports the card as selected to accessibility services.

shape

the card shape; defaults to JengaCardDefaults.shape.

colors

the color set; defaults to JengaCardDefaults.colors for variant and selected.

elevation

resting shadow depth; defaults to JengaCardDefaults.elevation.

contentPadding

inner padding around content; defaults to the theme's JengaCardStyle, else JengaCardDefaults.contentPadding.

borderWidth

width of the border, drawn inside the card edge; defaults to JengaCardDefaults.SelectedBorderWidth when selected, else the theme's JengaCardStyle, else JengaCardDefaults.BorderWidth.

disabledAlpha

opacity of the whole card when enabled is false; defaults to the theme's JengaCardStyle, else JengaCardDefaults.DisabledAlpha.

content

the card body, laid out in a ColumnScope.

Samples

JengaCard(
    content = {
        JengaText(
            text = "Gate A · Main entrance",
        )
    },
)