List

Rows of related content with optional icons, supporting text and trailing controls.

When to use

ListItem supports up to three lines with an overline, headline and supporting text, plus leading and trailing content. Clickable, selectable and checkable overloads share the same layout.

Segmented list items are the Expressive style. Each item is a separate rounded container with a small gap, and the first and last items have larger outer corners.

Playground

The interactive page has a playground with live property controls for this component and generated code.

Examples

Segmented, selectable

val names = listOf("Maya Chen", "Jonas Weber", "Ana Silva", "Kenji Sato")
var selected by rememberSaveable { mutableIntStateOf(0) }

Column(
    modifier = Modifier.widthIn(max = 420.dp).fillMaxWidth(),
    verticalArrangement = Arrangement.spacedBy(ListItemDefaults.SegmentedGap),
) {
    names.forEachIndexed { index, name ->
        SegmentedListItem(
            selected = selected == index,
            onClick = { selected = index },
            shapes = ListItemDefaults.segmentedShapes(index = index, count = names.size),
            leadingContent = { Icon(Icons.Rounded.Person, contentDescription = null) },
            supportingContent = { Text("Last active ${index + 1} h ago") },
        ) {
            Text(name)
        }
    }
}

Checkable

The whole row toggles.

val items = listOf("Wi-Fi", "Bluetooth", "Location")
var checked by remember { mutableStateOf(setOf("Wi-Fi")) }

Column(Modifier.widthIn(max = 420.dp).fillMaxWidth()) {
    items.forEach { item ->
        ListItem(
            checked = item in checked,
            onCheckedChange = { isChecked -> checked = if (isChecked) checked + item else checked - item },
            trailingContent = { Checkbox(checked = item in checked, onCheckedChange = null) },
        ) {
            Text(item)
        }
    }
}

Parameters

NameTypeDefaultDescription
headlineContent@Composable () -> UnitMain text. In the clickable overloads this is the trailing content lambda.
supportingContent@Composable (() -> Unit)?nullSecondary text.
overlineContent@Composable (() -> Unit)?nullSmall text above the headline.
leadingContent / trailingContent@Composable (() -> Unit)?nullIcons, avatars or controls.
shapesListItemShapesListItemDefaults.shapes()Interactive overloads. Use segmentedShapes(index, count).

Guidelines

Do:

Don't:

Accessibility

Related components