SVG Elements
The 63 elements of the W3C SVG 2 element index (as documented in the MDN SVG element reference), plus 25 obsolete or withdrawn elements flagged as deprecated. Each record captures the element name, a functional category (such as shape, filter, gradient, animation, text, container, or font), a concise description of the element's purpose, and a boolean flag indicating whether the element is deprecated. This dataset spans SVG 1.1 and SVG 2 elements including all filter primitives (fe*), font-related elements now removed from the SVG 2 specification, and withdrawn draft elements such as mesh gradients.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/svg-elements.json
Or use as a typed import:
import { svgElements } from "https://staticdata.dev/v1/svg-elements.ts"
Formats
- JSON 17.8 KB
/v1/svg-elements.json
min: 15.2 KB · /v1/svg-elements.min.json
- CSV 10.6 KB
/v1/svg-elements.csv
- TypeScript 18.0 KB
/v1/svg-elements.ts
export const svgElements
type SvgElement = (typeof svgElements)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| element | string | The SVG element tag name without angle brackets | circle |
| category | string | Functional category such as shape, filter, gradient, animation, text, or container | shape |
| description | string | Concise description of the element's purpose and usage | Draws a circle based on a center point and a radius. |
| deprecated | boolean | True if the element is deprecated and no longer recommended for use | false |
Preview
First 10 records.
| element | category | description | deprecated |
|---|---|---|---|
| a | container | Creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL. | false |
| altGlyph | text | Allowed sophisticated selection of the glyphs used to render its child character data. SVG 1.1 only; removed in SVG 2. | true |
| altGlyphDef | text | Defined a substitution representation for glyphs, referenced from altGlyph. SVG 1.1 only; removed in SVG 2. | true |
| altGlyphItem | text | Provided a set of candidate glyph substitutions within an altGlyphDef. SVG 1.1 only; removed in SVG 2. | true |
| animate | animation | Defines how an attribute of an element changes over time, providing simple animations on SVG elements. | false |
| animateColor | animation | Specified a color transformation over time. Deprecated in SVG 1.1 and removed in SVG 2; use animate instead. | true |
| animateMotion | animation | Moves an element along a defined motion path over time. | false |
| animateTransform | animation | Animates a transformation attribute on a target element, allowing animations of rotation, scaling, translation, and skewing. | false |
| circle | shape | Draws a circle based on a center point and a radius. | false |
| clipPath | clipping-masking | Defines a clipping path used by the clip-path property, restricting the region to which paint can be applied. | false |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/svg-elements.json | jq '.[0]' import type { SvgElement } from "https://staticdata.dev/v1/svg-elements.ts";
const res = await fetch("https://staticdata.dev/v1/svg-elements.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const svgElements: SvgElement[] = await res.json();
console.log(svgElements[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/svg-elements.min.json") as r:
svgElements = json.load(r)
print(svgElements[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/svg-elements.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/svg-elements.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The data is curated from the MDN SVG element reference and cross-referenced with the W3C SVG 2 specification. SVG (Scalable Vector Graphics) is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. The SVG specification defines a rich set of elements spanning geometry primitives, paint servers, filter effects, animation primitives, text rendering, and structural containers.
Elements are grouped into functional categories: shape elements (circle, ellipse, line, path, polygon, polyline, rect) describe geometric forms; container elements (defs, g, marker, pattern, svg, switch, symbol) group or define reusable content; gradient elements (linearGradient, radialGradient, stop, hatch, mesh*) define paint servers; filter elements (filter, fe*) compose raster-based effects; animation elements (animate, animateMotion, animateTransform, mpath, set) drive time-based changes; text elements (text, textPath, tspan) handle typographic rendering; descriptive elements (desc, metadata, title) carry accessible and machine-readable metadata; and font elements are now entirely deprecated in SVG 2 in favour of CSS font loading.
Deprecated elements (deprecated: true) are those not in the SVG 2 element index: the SVG 1.1 font elements (font, font-face, glyph, etc.), other SVG 1.1 elements removed in SVG 2 (altGlyph, altGlyphDef, altGlyphItem, animateColor, color-profile, cursor, tref, glyphRef, hkern, vkern), and the paint-server elements hatch, hatchpath, mesh, meshgradient, meshpatch, meshrow and solidcolor, which appeared in SVG 2 drafts but were removed before Candidate Recommendation and are not supported by any browser. These should not be used in new SVG content.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
svg-elements changelog for this dataset's history.
Related datasets
More Web datasets
- aria-attributes
- character-encodings
- csp-directives
- credit-card-types
- dns-record-types
- dom-events
- emoji
- emoji-shortcodes
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-cache-directives
- http-content-codings
- http-headers
- http-methods
- http-status-codes
- http-versions
- iframe-sandbox-tokens
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris