ListHeader

Composable Component

A slot based composable for creating a list header item. ListHeaders are typically expected to be a few words of text on a single line. The contents will be start and end padded.

Android
@Composable
public fun ListHeader(
    modifier: Modifier = Modifier,
    backgroundColor: Color = Color.Transparent,
    contentColor: Color = ListHeaderDefaults.contentColor,
    contentPadding: PaddingValues = ListHeaderDefaults.ContentPadding,
    transformation: SurfaceTransformation? = null,
    content: @Composable RowScope.() -> Unit,
)

Parameters

modifierThe modifier for the ListHeader.
backgroundColorThe background color to apply - typically Color.Transparent
contentColorThe color to apply to content.
contentPaddingThe spacing values to apply internally between the background and the content.
transformationTransformation to be used when header appears inside the container that needs to dynamically change its content separately from the background.
contentSlot for ListHeader content, expected to be a single line of text.