Path: blob/main/files/en-us/web/svg/element/animate/index.md
6567 views
------{{SVGRef}}
The SVG <animate> element provides a way to animate an attribute of an element over time.
Example
{{EmbedLiveSample('Example', 150, '100%')}}
Attributes
Animation Attributes
: {{SVGAttr("begin")}}, {{SVGAttr("dur")}}, {{SVGAttr("end")}}, {{SVGAttr("min")}}, {{SVGAttr("max")}}, {{SVGAttr("restart")}}, {{SVGAttr("repeatCount")}}, {{SVGAttr("repeatDur")}}, {{SVGAttr("fill")}}
: {{SVGAttr("calcMode")}}, {{SVGAttr("values")}}, {{SVGAttr("keyTimes")}}, {{SVGAttr("keySplines")}}, {{SVGAttr("from")}}, {{SVGAttr("to")}}, {{SVGAttr("by")}}
: Most notably: {{SVGAttr("attributeName")}}, {{SVGAttr("additive")}}, {{SVGAttr("accumulate")}}
: Most notably: {{SVGAttr("onbegin")}}, {{SVGAttr("onend")}}, {{SVGAttr("onrepeat")}}
Global attributes
: Most notably: {{SVGAttr('id')}}
: {{SVGAttr('class')}}, {{SVGAttr('style')}}
Event Attributes
Usage notes
This element implements the {{domxref("SVGAnimateElement")}} interface.
Accessibility concerns
Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity.
Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query or equivalent User Agent client hint {{HTTPHeader("Sec-CH-Prefers-Reduced-Motion")}} to create a complimentary experience for users who have expressed a preference for no animated experiences.
Designing Safer Web Animation For Motion Sensitivity · An A List Apart Article
An Introduction to the Reduced Motion Media Query | CSS-Tricks
Understanding Success Criterion 2.2.2 | W3C Understanding WCAG 2.0
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}