Compose Component

ListHeader

A slot based composable for creating a list header item.

ScalingLazyColumnWithHeaders

@Sampled
@Composable
fun ScalingLazyColumnWithHeaders() {
    ScalingLazyColumn(modifier = Modifier.fillMaxWidth()) {
        item { ListHeader { Text("Header1") } }
        items(5) {
            Chip(
                onClick = {},
                label = { Text("List item $it") },
                colors = ChipDefaults.secondaryChipColors(),
            )
        }
        item { ListHeader { Text("Header2") } }
        items(5) {
            Chip(
                onClick = {},
                label = { Text("List item ${it + 5}") },
                colors = ChipDefaults.secondaryChipColors(),
            )
        }
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: