ListSubHeader

Composable Component

A two slot based composable for creating a list sub-header item. ListSubHeaders offer slots for an icon and for a text label. The contents will be start and end padded.

Android
@Composable
public fun ListSubHeader(
    modifier: Modifier = Modifier,
    backgroundColor: Color = Color.Transparent,
    contentColor: Color = ListHeaderDefaults.subHeaderContentColor,
    contentPadding: PaddingValues = ListHeaderDefaults.SubHeaderContentPadding,
    transformation: SurfaceTransformation? = null,
    icon: (@Composable BoxScope.() -> Unit)? = null,
    label: @Composable RowScope.() -> Unit,
)

Parameters

modifierThe modifier for the ListSubHeader.
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.
transformationTransformer to be used when header appears inside the container that needs to dynamically change its content separately from the background.
iconA slot for providing icon to the ListSubHeader.
labelA slot for providing label to the ListSubHeader.