← Back to Material Compose
ListItem
Component
in
Material
. Since 0.1.0-dev15Overview
Code Examples
<a href="https://material.io/components/lists" class="external" target="_blank">Material Design list</a> item.
Lists are continuous, vertical indexes of text or images.
!Lists image(https://developer.android.com/images/reference/androidx/compose/material/lists.png)
To make this ListItem clickable, use Modifier.clickable. To add a background to the ListItem, wrap it with a Surface.
This component can be used to achieve the list item templates existing in the spec. For example:
- one-line items
Overloads
ListItem
@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
Name | Description |
---|---|
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 ite |