shimmerEffect
A shimmer effect modifier for Jetpack Compose UI elements.
This modifier applies a shimmering gradient background to a composable, creating a loading or placeholder effect. The shimmer moves horizontally across the component in a continuous loop.
The colors of the shimmer are derived from the current MaterialTheme.colorScheme. It uses a linear gradient with colors transitioning from surfaceContainer, to outlineVariant, to surfaceContainerHighest, and back to surfaceContainer.
The animation is an infinite repeatable tween with a duration of 1500ms.
Box(
modifier = Modifier
.size(SizeConstants.OneHundredSize)
.shimmerEffect()
)Content copied to clipboard
Return
A Modifier that applies the shimmer effect.