SVG Attribute reference
SVG elements can be modified using attributes that modify how the element is handled or rendered.
Below is a list of all of the attributes available in SVG, along with links to reference documentation to help you learn which elements support them and how they work.
SVG attributes A to Z
>A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
scaleseedshape-renderingsideslopespacingspecularConstantspecularExponentspreadMethodstartOffsetstdDeviationstitchTilesstop-colorstop-opacitystrokestroke-dasharraystroke-dashoffsetstroke-linecapstroke-linejoinstroke-miterlimitstroke-opacitystroke-widthstylesurfaceScalesystemLanguage
T
U
V
W
X
Y
Z
SVG attributes by category
>Core attributes
The core attributes are global attributes, and can be used on any SVG element:
The xml:lang attribute can also be used on SVG elements in XML documents. If both lang and xml:lang are set on an element, their values must match (ignoring ASCII letter case).
ARIA attributes
ARIA attributes are the role attribute and the aria-* states and properties defined in WAI-ARIA.
The following SVG elements accept ARIA attributes: a, circle, ellipse, foreignObject, g, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tspan, use, and view.
The switch and view elements accept aria-* attributes, but the role attribute can't be used on them.
ARIA attributes have no effect on other SVG elements, because those elements are never drawn and so are not included in the accessibility tree.
See the ARIA attributes reference and ARIA roles reference for more information.
Conditional processing attributes
The conditional processing attributes control whether the elements they are set on are processed.
XLink attributes
The XLink attributes can reference resources.
Presentation attributes
SVG presentation attributes are SVG attributes that can also be used as CSS properties on SVG elements.
They set CSS property values on an element with a specificity of 0, so other author styles in a stylesheet or style attribute can override them.
Presentation attribute values are parsed as CSS values, not declarations, so they cannot contain !important.
Most presentation attributes inherit when used as CSS properties (for example, fill and stroke).
Geometry properties are the main exception: their CSS counterparts do not inherit.
alignment-baselinebaseline-shiftclipclip-pathclip-rulecolorcolor-interpolationcolor-interpolation-filterscursorcxcyddirectiondisplaydominant-baselinefillfill-opacityfill-rulefilterflood-colorflood-opacityfont-familyfont-sizefont-size-adjustfont-stretchfont-stylefont-variantfont-weightfont-widthglyph-orientation-horizontalglyph-orientation-verticalheightimage-renderingletter-spacinglighting-colormarker-endmarker-midmarker-startmaskmask-typeopacityoverflowpathLengthpointer-eventsrrxryshape-renderingstop-colorstop-opacitystrokestroke-dasharraystroke-dashoffsetstroke-linecapstroke-linejoinstroke-miterlimitstroke-opacitystroke-widthtext-anchortext-decorationtext-overflowtext-renderingtransformtransform-originunicode-bidivector-effectvisibilitywidthwhite-spaceword-spacingwriting-modexy
Geometry properties
Geometry properties describe the position and dimensions of SVG shapes. In SVG 2, they are a defined subset of presentation attributes whose CSS counterparts do not inherit.
Each geometry property applies as a presentation attribute only on certain elements.
For example, r defines the radius of a <circle>, but has no effect on elements such as <rect>.
The SVG geometry properties are:
For element-by-element applicability, see each property's attribute page and the list on the <g> element page.
Filters attributes
Animation attributes
Event attributes
All HTML and SVG elements support event handler attributes defined on the GlobalEventHandlers mixin.
While event handler attributes, like onblur and onauxclick, apply to all elements, they may not have any effect. For example, the oncuechange attribute can be applied to any element, but it is only relevant to the <track> element.
Event handler attributes are discouraged, considered unsafe, and may be blocked by content security policies (CSP). Use the event name within an addEventListener() method instead.