ListItem

@Composable
fun ListItem(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, selected: Boolean = false, style: Style = ListItemDefaults.style(), contentPadding: PaddingValues = ListItemDefaults.contentPadding, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, horizontalArrangement: Arrangement.Horizontal = Arrangement.spacedBy(ListItemDefaults.contentSpacing), interactionSource: MutableInteractionSource? = null, content: @Composable () -> Unit)

A list item with content only — no leading or trailing slots.

Since

0.6.0

Parameters

onClick

Callback invoked when the list item is clicked.

modifier

Modifier to apply to the list item.

enabled

Whether the list item is enabled.

selected

Whether the list item is currently selected.

style

The Style for interaction states.

contentPadding

Padding applied inside the list item.

verticalAlignment

Vertical alignment of the row content.

horizontalArrangement

Horizontal arrangement of the row content.

interactionSource

Optional MutableInteractionSource for observing Interactions.

content

Main content of the list item.


@Composable
fun ListItem(onClick: () -> Unit, leadingContent: @Composable () -> Unit?, trailingContent: @Composable () -> Unit?, modifier: Modifier = Modifier, enabled: Boolean = true, selected: Boolean = false, style: Style = ListItemDefaults.style(), contentPadding: PaddingValues = ListItemDefaults.contentPadding, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, horizontalArrangement: Arrangement.Horizontal = Arrangement.spacedBy(ListItemDefaults.contentSpacing), interactionSource: MutableInteractionSource? = null, content: @Composable () -> Unit)

A list item with leading, content, and trailing slots.

Since

0.6.0

Parameters

onClick

Callback invoked when the list item is clicked.

leadingContent

Content displayed at the start.

trailingContent

Content displayed at the end.

modifier

Modifier to apply to the list item.

enabled

Whether the list item is enabled.

selected

Whether the list item is currently selected.

style

The Style for interaction states.

contentPadding

Padding applied inside the list item.

verticalAlignment

Vertical alignment of the row content.

horizontalArrangement

Horizontal arrangement of the row content.

interactionSource

Optional MutableInteractionSource for observing Interactions.

content

Main content of the list item.