A little motion can make a hero illustration feel alive, but motion also pulls attention away from the words, and some people find moving content uncomfortable. This guide gives the Little Leaf plant from an earlier hero example a short, restrained sway: its leaves lean left, swing right, lean left again and settle back into their original pose after 4.8 seconds, never more than one and a half degrees from rest. Then it makes sure people who ask for less motion see a still plant, wherever the file ends up: inline in the page, as an image, as a CSS background or inside a picture element.

The plant was generated with the AI SVG generator on September 26, 2026 (Ultra, one SVG, transparent background) for Create an SVG Hero Illustration with Space for Your Headline, which shows its prompt and the proportional copy this guide starts from. Little Leaf, the shop on the example page, is fictional; nothing is sold there. No new generation was made for this guide, and the plant's 62 paths are unchanged. Grouping them, the sway, the example page and the checks were made by an AI coding agent, and AI assistance was used to write this guide and make its figures and video.
Open the example page or download the files: the original, the grouped static file, the animated file, the example page, a README and the check results.
Watch the tutorial on YouTube. Its narration uses a synthetic ElevenLabs voice.
The plant is decorative: it sets the mood of the page but adds no information, so it has an empty alt, as in the hero example. Its motion should be decorative too, which sets the limits:
Only the leaves move. The pot stays still, which keeps the plant grounded and the motion easy to read as wind, not as the whole picture sliding.
A generated SVG has no parts to animate yet. This one is 62 <path> elements in a flat list, with no groups. Each path is one filled shape, and the order of the list is the order they're painted in. So before anything can move, the paths that move together need a group.
The file's paint order makes the split possible:
Wrapping each run in a group keeps that order, so the file looks exactly the same. In Chrome and Edge, the grouped file rendered pixel-identical to the hero example's copy.
<g id="foliage-back" class="foliage"> <!-- paths 1-25, unchanged --> </g>
<g id="pot"> <!-- paths 26-32, unchanged --> </g>
<g id="foliage-front" class="foliage"> <!-- paths 33-62, unchanged --> </g>

Single leaves can't move on their own in this file, because some paths draw more than one part: the first path is the top leaf together with its stems down to the soil, and another draws two leaves and their shared stem. So the foliage moves as two groups. To check what a path draws in your own file, hide all the other paths and look at it alone.
The animation is CSS inside the SVG's own <style>, so it travels with the file:
.foliage { transform-box: view-box; transform-origin: 1020px 800px; }
@media (prefers-reduced-motion: no-preference) {
.foliage { animation: sway 2.4s ease-in-out 2 alternate; }
}
@keyframes sway {
from { transform: rotate(0deg); }
50% { transform: rotate(-1.5deg); }
to { transform: rotate(1.2deg); }
}
transform-box: view-box measures transform-origin in the file's own coordinates, and 1020, 800 is the base of the stems, where they meet the soil. Without a transform-origin, the leaves would rotate around the coordinate origin, 0, 0, which in this file lies off the picture to the left, so the base of the stems would slide about 34 units away from the pot at the widest lean.2 alternate plays the keyframes twice, the second time backwards, so the leaves end where they started. In both browsers, the inline copy ran two sway animations, one for each foliage group, each 2,400 ms long with 2 iterations, and both ended at 4,800 ms.@media (prefers-reduced-motion: no-preference), so it runs only when the viewer hasn't asked for reduced motion.

The CSS animation guide covers the mechanics of keyframes and timing in more detail.
The same animated file can sit in a page in several ways, and for some of them, how you test reduced motion changes what you see. The example page shows the file inline, as an <img>, as a CSS background and in a <picture> with a static source. It was tested with three motion settings in Chrome 155 and Edge 155, which behaved the same:
| Where the file is | No motion preference | Reduced-motion preference on | Reduced motion emulated in DevTools |
|---|---|---|---|
Inline <svg> | sways, then stops | still | still |
<img> | sways, then stops | still | sways, then stops |
| CSS background | sways, then stops | still | sways, then stops |
<picture> with a static source | sways, then stops | still (static file) | still (static file) |
| The file opened directly | sways, then stops | still | still |
"Preference on" means Chrome and Edge were started with the --force-prefers-reduced-motion switch, which makes the browser report a reduced-motion preference to the page and to every image in it, whatever the system says. It stands in for turning off Animation effects in Windows (Settings, Accessibility, Visual effects), which wasn't changed for this test. "Emulated in DevTools" means the same media emulation as the reduced-motion option in the DevTools Rendering panel, applied by the test script through the DevTools Protocol. In every case the last frame was pixel-identical to the static file.
Two things in that table matter when you test your own page:
<img> or a CSS background, the file's CSS animation still runs. The SVG Integration draft calls this an animated image document: declarative animation, which includes CSS animations, is allowed, but scripts aren't, and MDN notes that external resources aren't loaded either. The file's media query follows the preference the browser reports, which is why the image stayed still when that preference was on.<img> and the background kept moving. If you test only with emulation, an image can look broken when it isn't.The example's hero uses both safeguards:
<picture>
<source srcset="assets/little-leaf-static.svg" media="(prefers-reduced-motion: reduce)">
<img src="assets/little-leaf-sway.svg" width="1092" height="1152" alt="">
</picture>
The rule inside the file keeps the plant still wherever the file is used, even without the <picture>. The <source> swaps in the static file, which also works with emulation, and it switched live in both browsers: when reduced-motion emulation was turned on after the page loaded, the hero changed to the static file, and back again when it was turned off. The width and height attributes reserve the plant's space before it loads. No layout shift was measured at 320, 375 or 1280 pixels wide, or at 200% and 400% zoom.
The example page was checked in Chrome 155.0.8059.80 and Edge 155.0.4283.62 on Windows 11, served from a local web server: each of the five places above with the three motion settings, captured about three times a second for 6 seconds, with the last frame compared against the static file; the animation timing; the <picture> switching live; and the layout at several widths and zoom levels. Not tested: Firefox, Safari, real phones, the Windows setting itself, screen readers, and CPU or battery use.
To make your own plant or scene, describe it with a transparent background in the AI SVG generator, then group its paths by what should move, as above.
transform-box: view-box.alternate with an even number of iterations.@media (prefers-reduced-motion: no-preference).<img>, add a <picture> source with a static file for (prefers-reduced-motion: reduce), and keep width and height.--force-prefers-reduced-motion), not only with DevTools emulation.