by @alexstyl
✉️ Leave your feedback

← Back to Wear Material

placeholder

Modifier
in
Wear Material
. Since 1.1.0

Overview

Examples

Community Notes

Draws a placeholder shape over the top of a composable and animates a wipe off effect to remove the placeholder. Typically used whilst content is 'loading' and then 'revealed'.

Example of a Chip with icon and a label that put placeholders over individual content slots:

Overloads

placeholder

@Suppress("ComposableModifierFactory")
@ExperimentalWearMaterialApi
@Composable
public fun Modifier.placeholder(
    placeholderState: PlaceholderState,
    shape: Shape = MaterialTheme.shapes.small,
    color: Color =
        MaterialTheme.colors.onSurface.copy(alpha = 0.1f)
            .compositeOver(MaterialTheme.colors.surface)
)

Parameters

NameDescription
placeholderStatedetermines whether the placeholder is visible and controls animation effects for the placeholder.
shapethe shape to apply to the placeholder
colorthe color of the placeholder
Next ComponentAlert