Composable Component

ListItem

Lists are continuous, vertical indexes of text or images.

ListItem social preview

ListItem

Common
@Composable
@ExperimentalMaterialApi
fun ListItem(
    modifier: Modifier = Modifier,
    icon: @Composable (() -> Unit)? = null,
    secondaryText: @Composable (() -> Unit)? = null,
    singleLineSecondaryText: Boolean = true,
    overlineText: @Composable (() -> Unit)? = null,
    trailing: @Composable (() -> Unit)? = null,
    text: @Composable () -> Unit,
)

Parameters

modifier Modifier to be applied to the list item
icon The leading supporting visual of the list item
secondaryText The secondary text of the list item
singleLineSecondaryText Whether the secondary text is single line
overlineText The text displayed above the primary text
trailing The trailing meta text, icon, switch or checkbox
text The primary text of the list item