Manages an animation effect on an element with options to control playback.
The target element to animate.
The animation keyframes.
Optional
Optional configuration options.
An object with reactive properties and methods to control the animation.
const element = useTemplateRef<Element>('element') const keyframes = ref<Array<Keyframe>>([{ rotate: '0deg' }, { rotate: '360deg' }]) useAnimation(element, keyframes, { duration: 1000, immediate: true, iterations: Infinity, }) Copy
const element = useTemplateRef<Element>('element') const keyframes = ref<Array<Keyframe>>([{ rotate: '0deg' }, { rotate: '360deg' }]) useAnimation(element, keyframes, { duration: 1000, immediate: true, iterations: Infinity, })
Manages an animation effect on an element with options to control playback.