Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
<animate>

Animates a target attribute over time with linear, discrete, paced, or spline timing.

Supported value types include colors, lengths, numeric lists, and compatible path data. Non-interpolable values use discrete sampling; rendered attribute coverage depends on the target element.

The default parser recognizes animation elements. Advance the document clock with SVGDocument::setTime() and render to sample them; secure static documents do not animate.

Example

<circle cx="30" cy="40" r="18" fill="#2563eb">
<animate attributeName="cx" from="30" to="210"
dur="2s" fill="freeze" />
</circle>

The snapshots below show the result at the beginning, midpoint, and end of the active interval:

0 s: cx=30 1 s: cx=120 2 s: cx=210

Supported attributes

Attribute Support
attributeName Attribute to animate. Required for an override.
from, to, by Endpoint forms. values takes precedence when present.
values Semicolon-separated keyframe values.
calcMode linear, discrete, paced, and spline with validated keySplines.
keyTimes Normalized keyframe times when its count matches values.
href, xlink:href Optional target; otherwise the parent element is targeted.
begin, dur, end, fill Active-interval timing.
repeatCount, repeatDur, restart, min, max Repeat and active-duration controls.

begin and end resolve clock lists, host events, syncbase references, and repeat events with signed offsets. The default fill="remove" restores the underlying value; fill="freeze" retains the last sampled value.