fade

fun PlaceholderHighlight.Companion.fade(animationSpec: InfiniteRepeatableSpec<Float> = PlaceholderDefaults.fadeAnimationSpec): PlaceholderHighlight(source)

Creates a PlaceholderHighlight which fades in an appropriate color, using the given animationSpec.

Parameters

animationSpec

the AnimationSpec to configure the animation.

Samples

import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.github.fornewid.placeholder.foundation.PlaceholderHighlight
import io.github.fornewid.placeholder.material3.fade
import io.github.fornewid.placeholder.material3.placeholder
import io.github.fornewid.placeholder.material3.shimmer

fun main() { 
   //sampleStart 
   Text(
    text = "Content to display after content has loaded",
    modifier = Modifier
        .padding(16.dp)
        .placeholder(
            visible = true,
            highlight = PlaceholderHighlight.fade(),
        ),
) 
   //sampleEnd
}