SVG Elements Reference

All SVG 2 elements with category, content model and what they render

Searchable reference for SVG 2 elements — shapes, text, paint servers, filters, animation, and structural containers — with each element's category, purpose, and key attributes.

What are the basic SVG shape elements?

SVG has six basic shapes: rect, circle, ellipse, line, polyline, and polygon, plus the general-purpose path. Each takes geometric attributes — rect uses x, y, width, height; circle uses cx, cy, r; path uses the d attribute with a sequence of drawing commands. Everything else builds on these.

SVG is an XML vocabulary for two-dimensional graphics. Its elements fall into a handful of families — shapes, containers, paint servers, filters, text, and animation — and each renders or contributes to rendering in a specific way. This is a searchable offline reference.

How it works

Every element is tagged with the category it belongs to and a short description of what it does and the attributes you usually set:

  • Shapes (rect, circle, path) draw geometry; path is the most general, using the d attribute’s command sequence.
  • Containers (svg, g, defs, symbol) group and position other elements. Only svg and symbol create a new viewport.
  • Paint servers (linearGradient, radialGradient, pattern) define fills and strokes referenced via url(#id).
  • Filters (filter, feGaussianBlur, feMerge) form a pipeline of primitives, each reading an input and producing an output.
  • Text (text, tspan, textPath) lays out glyphs.
  • Animation (animate, animateTransform, set) changes attributes over time (SMIL).

Example

A blurred drop shadow uses a filter pipeline:

<filter id="shadow">
  <feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
  <feOffset in="blur" dx="2" dy="2" result="off"/>
  <feMerge>
    <feMergeNode in="off"/>
    <feMergeNode in="SourceGraphic"/>
  </feMerge>
</filter>

Notes

  • Reusable definitions (gradients, filters, symbols) go inside defs and are referenced by id so they do not render on their own.
  • The use element clones a referenced element, letting you reuse shapes and symbols efficiently.
  • This reference covers the common elements, not the entire SVG 2 specification.