Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
<set>

Sets an attribute to a discrete value for the duration of an animation.

Warning
Animation support is experimental. Parse with SVGParser::Options::enableExperimental = true to create an SVGSetElement.

<set> is the simplest SVG animation element. It sets a target attribute to a specified value when the animation is active. Unlike <animate>, it does not interpolate between values.

Example

<rect x="20" y="20" width="80" height="50" fill="#dc2626">
<set attributeName="fill" to="blue" begin="2s" dur="3s" />
</rect>

before: red active: blue after: red

Supported attributes

Attribute Support
attributeName Attribute to replace during the active interval.
to Replacement value.
href, xlink:href Optional target; otherwise the parent element is targeted.
Shared timing begin, dur, end, fill, repeatCount, repeatDur, restart, min, and max.

The default fill="remove" restores the underlying value after the active interval; fill="freeze" keeps the replacement. Event and syncbase timing are not resolved yet.