Composable Component

ListItem

ListItem is a component used to represent a single item in a androidx.xr.glimmer.list.VerticalList.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

ClickableListItemSample

@Composable
fun ClickableListItemSample() {
    ListItem(onClick = {}) { Text("Primary Label") }
}

ClickableListItemWithSupportingLabelAndLeadingIconSample

@Composable
fun ClickableListItemWithSupportingLabelAndLeadingIconSample() {
    ListItem(
        onClick = {},
        supportingLabel = { Text("Supporting Label") },
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Primary Label")
    }
}

ClickableListItemWithSupportingLabelSample

@Composable
fun ClickableListItemWithSupportingLabelSample() {
    ListItem(onClick = {}, supportingLabel = { Text("Supporting Label") }) { Text("Primary Label") }
}

ListItemSample

@Composable
fun ListItemSample() {
    ListItem { Text("Primary Label") }
}

ListItemWithSupportingLabelAndLeadingIconSample

@Composable
fun ListItemWithSupportingLabelAndLeadingIconSample() {
    ListItem(
        supportingLabel = { Text("Supporting Label") },
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Primary Label")
    }
}

ListItemWithSupportingLabelSample

@Composable
fun ListItemWithSupportingLabelSample() {
    ListItem(supportingLabel = { Text("Supporting Label") }) { Text("Primary Label") }
}