files/en-us/web/svg/reference/element/symbol/index.md
The <symbol> SVG element is used to define graphical template objects which can be instantiated by a {{SVGElement("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] A
<symbol>element itself is not meant to be rendered. Only instances of a<symbol>element (i.e., a reference to a<symbol>by a {{SVGElement("use")}} element) are rendered. That means that some browsers could refuse to directly display a<symbol>element even if the CSS {{cssxref('display')}} property tells otherwise.
{{svginfo}}
auto; Animatable: yesnone | xMinYMin | xMidYMin | xMaxYMin | xMinYMid | xMidYMid | xMaxYMid | xMinYMax | xMidYMax | xMaxYMax) (meet | slice)?; Default value: xMidYMid meet; Animatable: yesleft | center | right; Default value: None; Animatable: yestop | center | bottom; Default value: None; Animatable: yesauto; Animatable: yes0; Animatable: yes0; Animatable: yesThis element implements the {{domxref("SVGSymbolElement")}} interface.
html,
body,
svg {
height: 100%;
}
<svg viewBox="0 0 80 20" xmlns="http://www.w3.org/2000/svg">
<!-- Our symbol in its own coordinate system -->
<symbol id="myDot" width="10" height="10" viewBox="0 0 2 2">
<circle cx="1" cy="1" r="1" />
</symbol>
<!-- A grid to materialize our symbol positioning -->
<path
d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20"
fill="none"
stroke="pink" />
<!-- All instances of our symbol -->
<use href="#myDot" x="5" y="5" opacity="1.0" />
<use href="#myDot" x="20" y="5" opacity="0.8" />
<use href="#myDot" x="35" y="5" opacity="0.6" />
<use href="#myDot" x="50" y="5" opacity="0.4" />
<use href="#myDot" x="65" y="5" opacity="0.2" />
</svg>
{{EmbedLiveSample('Example', 150, '100%')}}
{{Specifications}}
{{Compat}}