DenseListItem

Composable Component

Lists are continuous, vertical indexes of text or images.

Android
@Composable
fun DenseListItem(
    selected: Boolean,
    onClick: () -> Unit,
    headlineContent: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    onLongClick: (() -> Unit)? = null,
    overlineContent: (@Composable () -> Unit)? = null,
    supportingContent: (@Composable () -> Unit)? = null,
    leadingContent: (@Composable BoxScope.() -> Unit)? = null,
    trailingContent: (@Composable () -> Unit)? = null,
    tonalElevation: Dp = ListItemDefaults.TonalElevation,
    shape: ListItemShape = ListItemDefaults.shape(),
    colors: ListItemColors = ListItemDefaults.colors(),
    scale: ListItemScale = ListItemDefaults.scale(),
    border: ListItemBorder = ListItemDefaults.border(),
    glow: ListItemGlow = ListItemDefaults.glow(),
    interactionSource: MutableInteractionSource? = null
)

Parameters

selecteddefines whether this ListItem is selected or not
onClickcalled when this ListItem is clicked
headlineContentthe Composable headline content of the list item
modifierModifier to be applied to the list item
enabledcontrols the enabled state of this list item. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
onLongClickcalled when this ListItem is long clicked (long-pressed).
leadingContentthe Composable leading content of the list item
overlineContentthe Composable content displayed above the headline content
supportingContentthe Composable content displayed below the headline content
trailingContentthe Composable trailing meta text, icon, switch or checkbox
tonalElevationthe tonal elevation of this list item
shapeListItemShape defines the shape of ListItem's container in different interaction states. See ListItemDefaults.shape.
colorsListItemColors defines the background and content colors used in the list item for different interaction states. See ListItemDefaults.colors
scaleListItemScale defines the size of the list item relative to its original size in different interaction states. See ListItemDefaults.scale
borderListItemBorder defines a border around the list item in different interaction states. See ListItemDefaults.border
glowListItemGlow defines a shadow to be shown behind the list item for different interaction states. See ListItemDefaults.glow
interactionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this list item. You can use this to change the list item's appearance or preview the list item in different states. Note that if null is provided, interactions will still happen internally.