Skip to content

animatePulse

@Composable



fun animatePulse(
    key: Any?, 
    from: Float = 0.8f, 
    to: Float = 1.0f, 
    spec: AnimationSpec = AnimationSpec()
): Float

Sweeps from from to to every time key changes, holding at to otherwise - a one-shot "pulse"/"pop" effect for a discrete event (a checkbox toggling, a radio button being selected) rather than the continuous value animateFloat/animateInt track toward a moving target. Pair with Easings.OutBack for a satisfying overshoot-then-settle bounce.

Does not pulse on the composable's initial composition - only on a later change of key.