Introduction to Scalable Vector Graphics (SVG): Animations

Michael Mangialardi
4 min readDec 18, 2018

In the previous article, I walked through creating a basic SVG. In this article, I will pick up where we left off and explore SVG animations.

Whereas bitmap/raster graphics are composed of individual pixels, vector graphics are composed of individual shapes.

This provides for the ability for vector graphics to scale without loss of quality as they can render clearly at any resolution.

There is another benefit, however, to SVGs being composed of individual shapes. Each shape can be styled as we desire.

Since each shape in a SVG can be styled, this gives us the ability to create animated graphics on the web.

Animating SVGs: A Basic Example

I’m going to be modifying the SVG we created in the former article.

Currently, we have the follow markup that creates our SVG:

<svg
viewBox="0 0 400 400"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="50%" cy="50%" r=25% />
<circle cx="50%" cy="50%" r=10% />
</svg>

--

--