Skip to main content
100%

learn svg through 24 examples

✓ Published2🌍 Public
Ddmr
Last edited Nov 15, 2021
Created on Nov 15, 2021

This example demonstrates how to build a series of SVG scenes by hand, progressing from a simple bauble ornament to a branching snowflake design. It shows how to apply clip paths, reuse elements with the `<use>` tag, and apply transformations like rotation and scaling to compose complex shapes. The code uses raw SVG elements such as `<circle>`, `<polygon>`, and `<path>`, along with `viewBox` coordinates centered on (0,0) and a radial gradient for shading. The examples are purely illustrative, with no data source or external library.

AI-generated description

Bauble

Added a rectangle with fill none to show off the boundary Helpful to have (0, 0) as centre of image

Tree

Had to increase the viewBox height to include the supplied coordinates

Bauble with decoration

This looks easy. Define a circle as the clipPath in <defs> then use clip-path in the polyline

snowflake

define one arm of the snowflake in defs then use that definition with rotation every 60 degrees

MIT Licensed

Similar vizzes