StylishListItem

fun StylishListItem(headline: String, supportingText: String? = null, modifier: Modifier = Modifier, onClick: () -> Unit? = null, onLongClick: () -> Unit? = null, enabled: Boolean = true, containerColor: Color = MaterialTheme.colorScheme.surface, contentColor: Color = MaterialTheme.colorScheme.onSurface, shape: Shape = RoundedCornerShape(StylishTheme.dimensions.connectedCornerRadius), tonalElevation: Dp = 0.dp, headlineMaxLines: Int = Int.MAX_VALUE, headlineOverflow: TextOverflow = TextOverflow.Ellipsis, headlineStyle: TextStyle = MaterialTheme.typography.titleMedium, supportingTextMaxLines: Int = Int.MAX_VALUE, supportingTextOverflow: TextOverflow = TextOverflow.Ellipsis, supportingTextStyle: TextStyle = MaterialTheme.typography.bodyMedium, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable () -> Unit? = null, content: @Composable () -> Unit? = null)

A standalone list item for one row of information with optional interaction, tap/long-press actions, and leading/trailing slots.

This is the plain (non-connected) sibling of the connected list-item family: it renders as an independent rounded surface rather than participating in connected-group geometry. Use it for single rows, or place several in a Column when the connected look is not wanted.

When onClick or onLongClick is provided, the row lifts with StylishTheme.dimensions.interactiveElevation and is exposed with Role.Button semantics; long-press fires a haptic pulse. When enabled is false the row ignores pointer input, is flagged disabled() in semantics, and its content is dimmed to 38 % alpha. Rows with no action at all render as static content.

Parameters

headline

Primary text of the row.

supportingText

Optional secondary text below the headline.

modifier

Modifier applied to the Surface root.

onClick

Called when the row is tapped. null makes the row non-interactive.

onLongClick

Called when the row is long-pressed. null disables long-press.

enabled

When false, the row ignores pointer input and is visually dimmed.

containerColor

Background color of the row. Defaults to MaterialTheme.colorScheme.surface.

contentColor

Default content color of the row. Defaults to MaterialTheme.colorScheme.onSurface.

shape

Corner shape of the row. Defaults to RoundedCornerShape with StylishTheme.dimensions.connectedCornerRadius.

tonalElevation

Tonal elevation of the row surface. Defaults to 0.dp.

headlineMaxLines

Maximum lines for headline.

headlineOverflow

Overflow strategy for headline.

headlineStyle

Text style for headline. Defaults to MaterialTheme.typography.titleMedium.

supportingTextMaxLines

Maximum lines for supportingText.

supportingTextOverflow

Overflow strategy for supportingText.

supportingTextStyle

Text style for supportingText. Defaults to MaterialTheme.typography.bodyMedium.

leadingContent

Optional content before the text block (e.g. an icon or a com.segnities007.stylishui.components.atoms.StylishAvatar).

trailingContent

Optional content after the text block (e.g. a chevron or a badge).

content

When non-null, replaces the entire leading/text/ trailing layout with caller-supplied content, which fills the row with Modifier.weight of 1f.

See also