PlaceholderHighlight

Defines the visual highlight animation applied to a placeholder.

A placeholder highlight provides animated visual effects that appear on top of placeholder content to indicate loading state. Common implementations include Shimmer, Fade, Pulse, CircularReveal, and LightReveal.

Implementations should define:

Example usage:

Box(
modifier = Modifier
.size(200.dp, 50.dp)
.placeholder(
visible = isLoading,
highlight = PlaceholderDefaults.shimmer
)
)

See also

for default highlight implementations

Inheritors

Properties

Link copied to clipboard

The animation specification for the highlight effect.

Functions

Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
abstract fun alpha(progress: Float): Float

Returns the alpha (opacity) of the highlight at the current animation progress.

Link copied to clipboard
abstract fun brush(@FloatRange(from = 0.0, to = 1.0) progress: Float, size: Size): Brush

Returns the brush to draw the highlight at the current animation progress.