This reference provides an overview of common SVG elementsand their key attributes. For complete details, always refer to the latest SVG specification on MDN Web Docs or W3C.
Element | Description | Common Attributes
------- | ----------- | -----------------
**Structure & Grouping**
`<svg>` | The root element for an SVG fragment. | `width`, `height`, `viewBox`, `preserveAspectRatio`, `x`, `y`, `xmlns` (http://www.w3.org/2000/svg)
`<g>` | Groups multiple elements. Transformations applied to`<g>` affect all its children. | `id`, `transform`, `fill`, `stroke`, `opacity`+ presentation attributes.
`<defs>` | Container for reusable definitions (gradients, patterns, filters, symbols). Not rendered directly. |
`<use>` | Instances a defined element (e.g., from`<defs>`or another element with an `id`). | `href` (or`xlink:href`for older compatibility), `x`, `y`, `width`, `height`, `transform`.
`<symbol>` | Defines a graphical template object used by`<use>`. Has `viewBox`and`preserveAspectRatio`. | `id`, `viewBox`, `preserveAspectRatio`.
`<a>` | Creates a hyperlink around SVG elements. | `href`, `target`, `download`.
`<tspan>` | A child of `<text>`or other `<tspan>`s, for styling or positioning parts of text. | Similar to`<text>`, plus `dx`, `dy`relativeto current text position.
`<textPath>` | Arranges text along a `<path>`. | `href` (references a path), `startOffset`, `method`, `spacing`.
`Presentation Attributes` | Many elements accept attributes like`fill`, `stroke`, `stroke-width`, `opacity`, `font-size`, etc., as alternatives to CSS. | (Numerous, applyto specific elements)
**Gradients & Patterns**
`<linearGradient>` | Defines a linear color gradient. | `id`, `x1`, `y1`, `x2`, `y2`, `gradientUnits`, `gradientTransform`, `spreadMethod`.
`<radialGradient>` | Defines a radial color gradient. | `id`, `cx`, `cy`, `r`, `fx`, `fy`, `fr`, `gradientUnits`, `gradientTransform`, `spreadMethod`.
`<stop>` | A color stopwithin a gradient. | `offset`, `stop-color`, `stop-opacity`.
`<pattern>` | Defines a graphical pattern to fill or stroke an element. | `id`, `x`, `y`, `width`, `height`, `patternUnits`, `patternContentUnits`, `patternTransform`, `viewBox`, `preserveAspectRatio`.
**Clipping & Masking**
`<clipPath>` | Defines a clipping path used to restrict the visible area of an element. | `id`, `clipPathUnits`.