Object

ListItemDefaults

Contains the default values used by list items.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object ListItemDefaults

Contains the default values used by list items.

Properties

Common
val ContentPadding: PaddingValues

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

Common
val Elevation: Dp

The default elevation of a list item

Common
val shape: Shape

The default shape of a list item

Common
val containerColor: Color

The container color of a list item

Common
val contentColor: Color

The content color of a list item

Common
@ExperimentalMaterial3ExpressiveApi val SegmentedGap: Dp

The vertical space between different SegmentedListItems.

Functions

@Composable fun colors() = MaterialTheme.colorScheme.defaultListItemColors

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

colors

@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.

Parameters

containerColor the container color of the list item.
contentColor the content color of the list item.
leadingContentColor the leading content color of the list item.
trailingContentColor the trailing content color of the list item.
overlineContentColor the overline content color of the list item.
supportingContentColor the supporting content color of the list item.
disabledContainerColor the container color of the list item when disabled.
disabledContentColor the content color of the list item when disabled.
disabledLeadingContentColor the leading content color of the list item when disabled.
disabledTrailingContentColor the trailing content color of the list item when disabled.
disabledOverlineContentColor the overline content color of the list item when disabled.
disabledSupportingContentColor the supporting content color of the list item when disabled.
selectedContainerColor the container color of the list item when selected.
selectedContentColor the content color of the list item when selected.
selectedLeadingContentColor the leading content color of the list item when selected.
selectedTrailingContentColor the trailing content color of the list item when selected.
selectedOverlineContentColor the overline content color of the list item when selected.
selectedSupportingContentColor the supporting content color of the list item when selected.
draggedContainerColor the container color of the list item when dragged.
draggedContentColor the content color of the list item when dragged.
draggedLeadingContentColor the leading content color of the list item when dragged.
draggedTrailingContentColor the trailing content color of the list item when dragged.
draggedOverlineContentColor the overline content color of the list item when dragged.
draggedSupportingContentColor the supporting content color of the list item when dragged.

segmentedColors

@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun segmentedColors(): ListItemColors

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


segmentedColors

@ExperimentalMaterial3ExpressiveApi
    @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.

Parameters

containerColor the container color of the list item.
contentColor the content color of the list item.
leadingContentColor the leading content color of the list item.
trailingContentColor the trailing content color of the list item.
overlineContentColor the overline content color of the list item.
supportingContentColor the supporting content color of the list item.
disabledContainerColor the container color of the list item when disabled.
disabledContentColor the content color of the list item when disabled.
disabledLeadingContentColor the leading content color of the list item when disabled.
disabledTrailingContentColor the trailing content color of the list item when disabled.
disabledOverlineContentColor the overline content color of the list item when disabled.
disabledSupportingContentColor the supporting content color of the list item when disabled.
selectedContainerColor the container color of the list item when selected.
selectedContentColor the content color of the list item when selected.
selectedLeadingContentColor the leading content color of the list item when selected.
selectedTrailingContentColor the trailing content color of the list item when selected.
selectedOverlineContentColor the overline content color of the list item when selected.
selectedSupportingContentColor the supporting content color of the list item when selected.
draggedContainerColor the container color of the list item when dragged.
draggedContentColor the content color of the list item when dragged.
draggedLeadingContentColor the leading content color of the list item when dragged.
draggedTrailingContentColor the trailing content color of the list item when dragged.
draggedOverlineContentColor the overline content color of the list item when dragged.
draggedSupportingContentColor the supporting content color of the list item when dragged.

shapes

@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun shapes(): ListItemShapes

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


shapes

@ExperimentalMaterial3ExpressiveApi
    @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.

Parameters

shape the default shape of the list item.
selectedShape the shape of the list item when selected.
pressedShape the shape of the list item when pressed.
focusedShape the shape of the list item when focused.
hoveredShape the shape of the list item when hovered.
draggedShape the shape of the list item when dragged.

segmentedShapes

@ExperimentalMaterial3ExpressiveApi
    @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.

Parameters

index the index for this list item in the overall list.
count the total count of list items in the overall list.
defaultShapes the default ListItemShapes that should be used for standalone items or items in the middle of the list.

elevation

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

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

Parameters

elevation the default elevation of the list item.
draggedElevation the elevation of the list item when dragged.

verticalAlignment

@ExperimentalMaterial3ExpressiveApi
    @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.


colors

@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.

Parameters

containerColor the container color of this list item when enabled.
headlineColor the headline text content color of this list item when enabled.
leadingIconColor the color of this list item's leading content when enabled.
overlineColor the overline text color of this list item
supportingColor the supporting text color of this list item
trailingIconColor the color of this list item's trailing content when enabled.
disabledHeadlineColor the content color of this list item when not enabled.
disabledLeadingIconColor the color of this list item's leading content when not enabled.
disabledTrailingIconColor the color of this list item's trailing content when not enabled.