androidx.compose.material3
ListItem
Composable function
A list item is one row in a list. It has a headline, and optionally a line above, a line below, something at the start, and something at the end.
Put list items in a LazyColumn for long lists.

Column(Modifier.width(360.dp)) {
ListItem(headlineContent = { Text("One line") })
HorizontalDivider()
ListItem(
headlineContent = { Text("Two lines") },
supportingContent = { Text("Supporting text") },
)
HorizontalDivider()
ListItem(
overlineContent = { Text("OVERLINE") },
headlineContent = { Text("Three lines") },
supportingContent = { Text("Supporting text that is a bit longer") },
)
}

var on by remember { mutableStateOf(true) }
ListItem(
headlineContent = { Text("Notifications") },
supportingContent = { Text("Sounds and banners") },
leadingContent = { Icon(Icons.Filled.Notifications, contentDescription = null) },
trailingContent = { Switch(checked = on, onCheckedChange = { on = it }) },
modifier = Modifier.width(360.dp),
)
The newer forms (clickable, selectable, toggleable) make the whole row react, and change shape while pressed. They are Expressive.

var checked by remember { mutableStateOf(true) }
ListItem(
checked = checked,
onCheckedChange = { checked = it },
leadingContent = { Checkbox(checked = checked, onCheckedChange = null) },
supportingContent = { Text("The whole row is clickable") },
modifier = Modifier.width(360.dp),
) {
Text("Show previews")
}
SegmentedListItem is for lists where items touch, like a settings group. Give each item the shape for its position, so only the outer corners of the group are round.
Basic
Not clickable. Add Modifier.clickable yourself if needed.
@Composable
fun ListItem(
headlineContent: @Composable () -> Unit,
modifier: Modifier = Modifier,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
colors: ListItemColors = ListItemDefaults.colors(),
tonalElevation: Dp = ListItemDefaults.Elevation,
shadowElevation: Dp = ListItemDefaults.Elevation,
)
headlineContent: @Composable () -> UnitRequired
headlineContent: @Composable () -> UnitRequiredThe main text of the row. Usually one Text.
modifier: ModifierOptional
modifier: ModifierOptionalDefault: Modifier
Changes size, padding, or position. See the Modifier guide.
overlineContent: @Composable (() -> Unit)?Optional
overlineContent: @Composable (() -> Unit)?OptionalDefault: null
A small line above the headline.
supportingContent: @Composable (() -> Unit)?Optional
supportingContent: @Composable (() -> Unit)?OptionalDefault: null
A line or two below the headline, with more detail.
leadingContent: @Composable (() -> Unit)?Optional
leadingContent: @Composable (() -> Unit)?OptionalDefault: null
Something at the start: an icon, an avatar or a checkbox.

ListItem(
headlineContent = { Text("Alex Doe") },
supportingContent = { Text("See you at 6?") },
leadingContent = {
Surface(shape = CircleShape, color = MaterialTheme.colorScheme.primaryContainer) {
Icon(Icons.Filled.Person, contentDescription = null, Modifier.padding(8.dp))
}
},
trailingContent = { Text("12:30") },
modifier = Modifier.width(360.dp),
)
trailingContent: @Composable (() -> Unit)?Optional
trailingContent: @Composable (() -> Unit)?OptionalDefault: null
Something at the end: a switch, a checkbox, a time or an icon.
colors: ListItemColorsOptional
colors: ListItemColorsOptionalDefault: ListItemDefaults.colors()
Sets background and content colors.
Make one with ListItemDefaults.colors.

ListItem(
headlineContent = { Text("Selected") },
leadingContent = { Icon(Icons.Filled.Favorite, contentDescription = null) },
colors = androidx.compose.material3.ListItemDefaults.colors(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
),
modifier = Modifier.width(360.dp),
)
tonalElevation: DpOptional
tonalElevation: DpOptionalDefault: ListItemDefaults.Elevation
Tints the background a little toward the primary color.
shadowElevation: DpOptional
shadowElevation: DpOptionalDefault: ListItemDefaults.Elevation
The size of the shadow under the row.
ClickableSince 1.11Experimental
Takes onClick. The headline goes in content.
@Composable
fun ListItem(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
verticalAlignment: Alignment.Vertical = ListItemDefaults.verticalAlignment(),
onLongClick: (() -> Unit)? = null,
onLongClickLabel: String? = null,
shapes: ListItemShapes = ListItemDefaults.shapes(),
colors: ListItemColors = ListItemDefaults.colors(),
elevation: ListItemElevation = ListItemDefaults.elevation(),
contentPadding: PaddingValues = ListItemDefaults.ContentPadding,
interactionSource: MutableInteractionSource? = null,
content: @Composable () -> Unit,
)
onClick: () -> UnitRequired
onClick: () -> UnitRequiredCalled when the row is clicked.
enabled: BooleanOptional
enabled: BooleanOptionalDefault: true
Set to false to make the row gray and not clickable.
verticalAlignment: Alignment.VerticalOptional
verticalAlignment: Alignment.VerticalOptionalDefault: ListItemDefaults.verticalAlignment()
How the leading and trailing content line up with the text: top or centered.
onLongClick: (() -> Unit)?Optional
onLongClick: (() -> Unit)?OptionalDefault: null
Called when the row is pressed for a long time.
onLongClickLabel: String?Optional
onLongClickLabel: String?OptionalDefault: null
What a long press does, for screen readers.
shapes: ListItemShapesOptional
shapes: ListItemShapesOptionalDefault: ListItemDefaults.shapes()
Sets the row shape at rest, pressed, selected and so on.
elevation: ListItemElevationOptional
elevation: ListItemElevationOptionalDefault: ListItemDefaults.elevation()
Sets the tint and shadow in different states.
contentPadding: PaddingValuesOptional
contentPadding: PaddingValuesOptionalDefault: ListItemDefaults.ContentPadding
Space between the edge of the row and its content.
interactionSource: MutableInteractionSource?Optional
interactionSource: MutableInteractionSource?OptionalDefault: null
Lets you observe or control press, hover and focus states. Leave it null unless your code must react to them. See InteractionSource.
content: @Composable () -> UnitRequired
content: @Composable () -> UnitRequiredThe main text of the row, in the newer forms. Same as headlineContent.
Same as above: modifier, leadingContent, trailingContent, overlineContent, supportingContent, colors.
SelectableSince 1.11Experimental
Takes selected and onClick.
@Composable
fun ListItem(
selected: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
verticalAlignment: Alignment.Vertical = ListItemDefaults.verticalAlignment(),
onLongClick: (() -> Unit)? = null,
onLongClickLabel: String? = null,
shapes: ListItemShapes = ListItemDefaults.shapes(),
colors: ListItemColors = ListItemDefaults.colors(),
elevation: ListItemElevation = ListItemDefaults.elevation(),
contentPadding: PaddingValues = ListItemDefaults.ContentPadding,
interactionSource: MutableInteractionSource? = null,
content: @Composable () -> Unit,
)
selected: BooleanRequired
selected: BooleanRequiredWhether the row is selected.
Same as above: onClick, modifier, enabled, leadingContent, trailingContent, overlineContent, supportingContent, verticalAlignment, onLongClick, onLongClickLabel, shapes, colors, elevation, contentPadding, interactionSource, content.
ToggleableSince 1.11Experimental
Takes checked and onCheckedChange. The whole row toggles.
@Composable
fun ListItem(
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
verticalAlignment: Alignment.Vertical = ListItemDefaults.verticalAlignment(),
onLongClick: (() -> Unit)? = null,
onLongClickLabel: String? = null,
shapes: ListItemShapes = ListItemDefaults.shapes(),
colors: ListItemColors = ListItemDefaults.colors(),
elevation: ListItemElevation = ListItemDefaults.elevation(),
contentPadding: PaddingValues = ListItemDefaults.ContentPadding,
interactionSource: MutableInteractionSource? = null,
content: @Composable () -> Unit,
)
checked: BooleanRequired
checked: BooleanRequiredWhether the row is checked.
onCheckedChange: (Boolean) -> UnitRequired
onCheckedChange: (Boolean) -> UnitRequiredCalled with the new value when the row is clicked.
Same as above: modifier, enabled, leadingContent, trailingContent, overlineContent, supportingContent, verticalAlignment, onLongClick, onLongClickLabel, shapes, colors, elevation, contentPadding, interactionSource, content.
Longer Example
A contact list: avatar, name and email, a favorite toggle, and dividers that start after the avatar.
The list is a mutableStateListOf. Changing an element (contacts[i] = contact.copy(...)) updates the screen. A whole row is clickable with Modifier.clickable; the star is its own button inside it.

val sampleContacts = listOf(
// A list of rows the user can change. mutableStateListOf updates the screen on every change.
val contacts = remember { sampleContacts.take(4).toMutableStateList() }
LazyColumn(Modifier.width(360.dp)) {
items(contacts, key = { it.id }) { contact ->
ListItem(
headlineContent = { Text(contact.name) },
supportingContent = { Text(contact.email) },
leadingContent = { Avatar(contact.name) },
trailingContent = {
IconToggleButton(
checked = contact.favorite,
onCheckedChange = { on ->
val i = contacts.indexOfFirst { it.id == contact.id }
contacts[i] = contact.copy(favorite = on)
},
) {
Icon(
Icons.Filled.Star,
contentDescription = "Favorite",
tint = if (contact.favorite) MaterialTheme.colorScheme.primary
else MaterialTheme.colorScheme.outlineVariant,
)
}
},
modifier = Modifier.clickable { /* open the contact */ },
)
HorizontalDivider(Modifier.padding(start = 72.dp))
}
}
/** The data of one row. A data class with a stable id, used as the list key. */
data class Contact(val id: Int, val name: String, val email: String, val favorite: Boolean = false)
private val sampleContacts = listOf(
Contact(1, "Ada Lovelace", "ada@example.com", favorite = true),
Contact(2, "Alan Turing", "alan@example.com"),
Contact(3, "Barbara Liskov", "barbara@example.com"),
Contact(4, "Grace Hopper", "grace@example.com", favorite = true),
Contact(5, "Katherine Johnson", "katherine@example.com"),
Contact(6, "Linus Torvalds", "linus@example.com"),
)
/** A round avatar with the first letter of the name. */
@Composable
private fun Avatar(name: String) {
Box(
Modifier.size(40.dp).background(MaterialTheme.colorScheme.primaryContainer, CircleShape),
contentAlignment = Alignment.Center,
) { Text(name.take(1), color = MaterialTheme.colorScheme.onPrimaryContainer) }
}
List item types
ListItemSegmentedListItem
See also
ListItemDefaults: default values and helper functions forListItem.