JengaListItem

fun JengaListItem(headline: String, modifier: Modifier = Modifier, supporting: String? = null, supportingContent: @Composable () -> Unit? = null, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable () -> Unit? = null, onClick: () -> Unit? = null, enabled: Boolean = true, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, minHeight: Dp = JengaTheme.components.listItem?.minHeight ?: JengaListItemDefaults.MinHeight, contentPadding: PaddingValues = JengaListItemDefaults.contentPadding, headlineStyle: TextStyle = JengaListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaListItemDefaults.supportingStyle, contentSpacing: Dp = JengaListItemDefaults.contentSpacing, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, colors: JengaListItemColors = JengaListItemDefaults.colors())(source)

A single row in a list: a headline, optional supporting line, and optional leading/trailing slots (icons, avatars, controls).

Parameters

headline

the primary text.

modifier

the Modifier for this row.

supporting

optional secondary text below the headline.

supportingContent

optional slot below the headline (and below supporting when both are given), for rich supporting content such as badges or a status line. Inherits the supporting color.

leadingContent

optional start slot (inherits the leading/trailing color).

trailingContent

optional end slot (inherits the leading/trailing color).

onClick

optional click handler; makes the row focusable with a ripple.

enabled

when false, the row uses the disabled colors from colors and onClick is ignored.

headlineMaxLines

the maximum lines for headline before it is truncated.

supportingMaxLines

the maximum lines for supporting before it is truncated.

minHeight

the minimum row height; defaults to the theme's JengaListItemStyle.minHeight, else JengaListItemDefaults.MinHeight.

contentPadding

inner padding around the row content.

headlineStyle

the headline text style.

supportingStyle

the supporting text style.

contentSpacing

the gap between the leading content, the text and the trailing content.

verticalAlignment

how the leading content, the text and the trailing content align in a tall row.

colors

the color set; defaults to JengaListItemDefaults.colors.

Samples

JengaListItem(
    headline = "Gate A",
    supporting = "Main entrance",
    trailingContent = {
        JengaIcon(
            imageVector = JengaIcons.ChevronRight,
            contentDescription = null,
        )
    },
    onClick = { },
)

fun JengaListItem(headline: AnnotatedString, modifier: Modifier = Modifier, supporting: String? = null, supportingContent: @Composable () -> Unit? = null, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable () -> Unit? = null, onClick: () -> Unit? = null, enabled: Boolean = true, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, minHeight: Dp = JengaTheme.components.listItem?.minHeight ?: JengaListItemDefaults.MinHeight, contentPadding: PaddingValues = JengaListItemDefaults.contentPadding, headlineStyle: TextStyle = JengaListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaListItemDefaults.supportingStyle, contentSpacing: Dp = JengaListItemDefaults.contentSpacing, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, colors: JengaListItemColors = JengaListItemDefaults.colors())(source)

A JengaListItem whose headline is styled text (e.g. a monospaced id beside plain words).

Parameters

headline

the primary text, with styled spans.

modifier

the Modifier for this row.

supporting

optional secondary text below the headline.

supportingContent

optional slot below the headline (and below supporting when both are given), for rich supporting content such as badges or a status line. Inherits the supporting color.

leadingContent

optional start slot (inherits the leading/trailing color).

trailingContent

optional end slot (inherits the leading/trailing color).

onClick

optional click handler; makes the row focusable with a ripple.

enabled

when false, the row uses the disabled colors from colors and onClick is ignored.

headlineMaxLines

the maximum lines for headline before it is truncated.

supportingMaxLines

the maximum lines for supporting before it is truncated.

minHeight

the minimum row height; defaults to the theme's JengaListItemStyle.minHeight, else JengaListItemDefaults.MinHeight.

contentPadding

inner padding around the row content.

headlineStyle

the headline text style; spans in headline override it.

supportingStyle

the supporting text style.

contentSpacing

the gap between the leading content, the text and the trailing content.

verticalAlignment

how the leading content, the text and the trailing content align in a tall row.

colors

the color set; defaults to JengaListItemDefaults.colors.