androidx.compose.material3

ListItemDefaults

Object

No hand-written docs yet.

Contains the default values used by list items.

object ListItemDefaults

Properties

ContentPaddingSince 1.11

val ContentPadding: PaddingValues

The default padding applied to all content within a list item.

Elevation

val Elevation: Dp

The default elevation of a list item

shape

@Composable val shape: Shape

The default shape of a list item

containerColor

@Composable val containerColor: Color

The container color of a list item

contentColor

@Composable val contentColor: Color

The content color of a list item

SegmentedGapSince 1.11Experimental

val SegmentedGap: Dp

The vertical space between different SegmentedListItems.

Functions

colors

@Composable
fun colors(): ListItemColors

Creates a ListItemColors that represents the default colors for a ListItem in different states.

@Composable
fun colors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    leadingContentColor: Color = Color.Unspecified,
    trailingContentColor: Color = Color.Unspecified,
    overlineContentColor: Color = Color.Unspecified,
    supportingContentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified,
    disabledLeadingContentColor: Color = Color.Unspecified,
    disabledTrailingContentColor: Color = Color.Unspecified,
    disabledOverlineContentColor: Color = Color.Unspecified,
    disabledSupportingContentColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedContentColor: Color = Color.Unspecified,
    selectedLeadingContentColor: Color = Color.Unspecified,
    selectedTrailingContentColor: Color = Color.Unspecified,
    selectedOverlineContentColor: Color = Color.Unspecified,
    selectedSupportingContentColor: Color = Color.Unspecified,
    draggedContainerColor: Color = Color.Unspecified,
    draggedContentColor: Color = Color.Unspecified,
    draggedLeadingContentColor: Color = Color.Unspecified,
    draggedTrailingContentColor: Color = Color.Unspecified,
    draggedOverlineContentColor: Color = Color.Unspecified,
    draggedSupportingContentColor: Color = Color.Unspecified,
): ListItemColors

Creates a ListItemColors that represents the default colors for a ListItem in different states.

segmentedColorsSince 1.11Experimental

@Composable
fun segmentedColors(): ListItemColors

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

@Composable
fun segmentedColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    leadingContentColor: Color = Color.Unspecified,
    trailingContentColor: Color = Color.Unspecified,
    overlineContentColor: Color = Color.Unspecified,
    supportingContentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified,
    disabledLeadingContentColor: Color = Color.Unspecified,
    disabledTrailingContentColor: Color = Color.Unspecified,
    disabledOverlineContentColor: Color = Color.Unspecified,
    disabledSupportingContentColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedContentColor: Color = Color.Unspecified,
    selectedLeadingContentColor: Color = Color.Unspecified,
    selectedTrailingContentColor: Color = Color.Unspecified,
    selectedOverlineContentColor: Color = Color.Unspecified,
    selectedSupportingContentColor: Color = Color.Unspecified,
    draggedContainerColor: Color = Color.Unspecified,
    draggedContentColor: Color = Color.Unspecified,
    draggedLeadingContentColor: Color = Color.Unspecified,
    draggedTrailingContentColor: Color = Color.Unspecified,
    draggedOverlineContentColor: Color = Color.Unspecified,
    draggedSupportingContentColor: Color = Color.Unspecified,
): ListItemColors

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

shapesSince 1.11Experimental

@Composable
fun shapes(): ListItemShapes

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

@Composable
fun shapes(
    shape: Shape? = null,
    selectedShape: Shape? = null,
    pressedShape: Shape? = null,
    focusedShape: Shape? = null,
    hoveredShape: Shape? = null,
    draggedShape: Shape? = null,
): ListItemShapes

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

segmentedShapesSince 1.11Experimental

@Composable
fun segmentedShapes(
    index: Int,
    count: Int,
    defaultShapes: ListItemShapes = shapes(),
): ListItemShapes

Constructor for ListItemShapes to be used by a SegmentedListItem which has an index in a list that has a total of count items.

elevationSince 1.11Experimental

fun elevation(
    elevation: Dp = ListTokens.ItemContainerElevation,
    draggedElevation: Dp = ListTokens.ItemDraggedContainerElevation,
): ListItemElevation

Creates a ListItemElevation that represents the elevation for a ListItem in different states.

verticalAlignmentSince 1.11Experimental

@Composable
fun verticalAlignment(): Alignment.Vertical

Returns the default vertical alignment of children content within a ListItem. This is equivalent to Alignment.CenterVertically for shorter items and Alignment.Top for taller items.

@Composable
fun colors(
    containerColor: Color = Color.Unspecified,
    headlineColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    overlineColor: Color = Color.Unspecified,
    supportingColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledHeadlineColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified,
): ListItemColors

Creates a ListItemColors that represents the default container and content colors used in a ListItem.

Library docs

Contains the default values used by list items.