Fade
data class Fade(highlightColor: Color, val animationSpec: InfiniteRepeatableSpec<Float>) : PlaceholderHighlight
A PlaceholderHighlight implementation that fades a solid color in and out.
This creates a simple breathing effect by animating the opacity of a highlight color over the placeholder. The fade effect is subtle and works well for most content types.
Example usage:
Box(
modifier = Modifier
.size(100.dp)
.placeholder(
visible = isLoading,
highlight = Fade(
highlightColor = Color.White.copy(alpha = 0.5f),
animationSpec = infiniteRepeatable(
animation = tween(durationMillis = 800),
repeatMode = RepeatMode.Reverse
)
)
)
)Content copied to clipboard
Parameters
highlight Color
The color of the fade overlay
animation Spec
The animation specification controlling the fade timing
See also
for a default configuration