Overview
keyframes(name, stops) injects a scoped @keyframes rule at module level and returns the CSS animation name (a string). Use it with inline animation styles or stylesheet rules — not as an animatedIf preset.
Call it once at module level (idempotent mount). For enter/exit WAAPI transitions, prefer animationPresets with animatedIf instead.
keyframes vs animationPresets
|
API
|
Returns
|
Wire-up
|
|---|---|---|
keyframes(name, stops)
|
string (CSS name)
|
style=`animation: ${name} 0.5s ease`
|
animationPresets.*
|
AnimationPreset
|
Pass to animatedIf / animatedRouter config.
|
Custom bounce with keyframes()
Define named @keyframes stops as a plain object. keyframes() injects the CSS once and returns the animation name — apply it via style.animation.
Looping pulse
Use infinite animation for attention states.