coderef

Web animationsBaseline · Widely available

The web animation API programmatically creates, inspects, and controls element animations, to change and synchronize appearance over time.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 16, 2020. Widely available since Mar 16, 2023.

Browser support

DesktopChrome
1–83Not supported
84+Supportedsince Jul 27, 2020
Current: 155
Edge
12–83Not supported
84+Supportedsince Jul 16, 2020
Current: 154
Firefox
1–74Not supported
75+Supportedsince Apr 7, 2020
Current: 157
Safari
1–13.1Not supported
14+Supportedsince Sep 16, 2020
Current: 27
MobileChrome Android
18–83Not supported
84+Supportedsince Jul 27, 2020
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–13.4Not supported
14+Supportedsince Sep 16, 2020
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Animation.

Feature detection

JS · check before using
if ("Animation" in globalThis) {
  // Animation is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (61). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Animation75794813.1754813.4
Animation.Animation75794813.1754813.4
Animation.cancel75794813.1754813.4
Animation.cancel_event75794813.1754813.4
Animation.commitStyles84847513.1847913.4
Animation.currentTime75794813.1754813.4
Animation.effect75796313.1756313.4
Animation.finish75794813.1754813.4
Animation.finish_event75794813.1754813.4
Animation.finished84846313.1846313.4
Animation.id75794813.1754813.4
Animation.pause75794813.1754813.4
Animation.pending76795913.1765913.4
Animation.persist84847513.1847913.4
Animation.play75794813.1754813.4
Animation.playState75794813.1754813.4
Animation.playbackRate75794813.1754813.4
Animation.ready84846313.1846313.4
Animation.remove_event84847513.1847913.4
Animation.remove_filling_animation84847513.1847913.4
Show 41 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Animation.replaceState84847513.1847913.4
Animation.reverse75794813.1754813.4
Animation.startTime75794813.1754813.4
Animation.timeline84847513.1847913.4
Animation.updatePlaybackRate76796013.1766013.4
AnimationEffect75796313.1756313.4
AnimationEffect.getComputedTiming75796313.1756313.4
AnimationEffect.getTiming75796313.1756313.4
AnimationEffect.updateTiming75796313.1756313.4
AnimationPlaybackEvent84846313.1846313.4
AnimationPlaybackEvent.AnimationPlaybackEvent84846313.1846313.4
AnimationPlaybackEvent.currentTime84846313.1846313.4
AnimationPlaybackEvent.timelineTime84846313.1846313.4
AnimationTimeline84847513.1847913.4
AnimationTimeline.currentTime84847513.1847913.4
AnimationTimeline.duration115115✕26115✕26
Document.getAnimations84847514847914
Document.timeline84847513.1847913.4
DocumentTimeline84847513.1847913.4
DocumentTimeline.DocumentTimeline84847513.1847913.4
Element.animate36794813.1364813.4
Element.animate.implicit_tofrom848475✕8479✕
Element.animate.options_composite_parameter84848016848016
Element.animate.options_id_parameter50794813.1504813.4
Element.animate.options_pseudoElement_parameter84847514847914
Element.animate.options_rangeEnd_parameter115115✕26115✕26
Element.animate.options_rangeStart_parameter115115✕26115✕26
Element.animate.options_timeline_parameter8585✕1685✕16
Element.animationcancel_event✕✕5413.1✕5413.4
Element.animationend_event791851979519
Element.animationiteration_event791851979519
Element.animationstart_event791851979519
Element.getAnimations84847513.1847913.4
KeyframeEffect75796313.1756313.4
KeyframeEffect.KeyframeEffect75796313.1756313.4
KeyframeEffect.composite84848016848016
KeyframeEffect.getKeyframes84846313.1846313.4
KeyframeEffect.pseudoElement84847514847914
KeyframeEffect.setKeyframes84846313.1846313.4
KeyframeEffect.target75796313.1756313.4
ShadowRoot.getAnimations84847514847914