The <symbol> element is used to define graphical template objects which can be instantiated by a <use> element. The use of symbol elements for graphics that are used multiple times in the same document adds structure and semantics. Documents that are rich in structure may be rendered graphically, as speech, or as Braille, and thus promote accessibility. Note that a symbol element itself is not rendered. Only instances of a symbol element (i.e., a reference to a symbol by a <use> element) are rendered.

Usage context

CategoriesContainer element, Structural element
Permitted contentAny number of the following elements, in any order:
Animation elements
Descriptive elements
Shape elements
Structural elements
Gradient elements
<a>, <altGlyphDef>, <clipPath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignObject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view>


Global attributes

Specific attributes

DOM Interface

This element implements the SVGSymbolElement interface.


<svg width="120" height="140">
<!-- symbol definition  NEVER draw -->
<symbol id="sym01" viewBox="0 0 150 110">
  <circle cx="50" cy="50" r="40" stroke-width="8"
      stroke="red" fill="red"/>
  <circle cx="90" cy="60" r="40" stroke-width="8"
      stroke="green" fill="white"/>

<!-- actual drawing by "use" element -->
<use href="#sym01"
     x="0" y="0" width="100" height="50"/>
<use href="#sym01"
     x="0" y="50" width="75" height="38"/>
<use href="#sym01"
     x="0" y="100" width="50" height="25"/>


Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<symbol>' in that specification.
Candidate Recommendation Allowed geometry properties to be specified on a symbol
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<symbol>' in that specification.
Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support1 Yes1.5993.1
preserveAspectRatio ? ? ? ? ? ?
viewBox ? ? ? ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support318 Yes4 Yes3.1 ?
preserveAspectRatio ? ? ? ? ? ? ?
viewBox ? ? ? ? ? ? ?

See also

Document Tags and Contributors

Last updated by: Jeremie,