SVG
How to Use
How to Use SVGs
Examples
Standalone Icon, Meaningful
Meaningful icons need a title. Think of this as similar to using alt text on an image. Height, width, and text color class can be changed according to usage.
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Phone Icon"><title>Phone Icon</title><use xlink:href="#svgIcon-phone"></use></svg>
Standalone Icon, Decorative
Decorative icons (icons that repeat the information conveyed by text or do not add significant value) do not need alternative text and they should be hidden from the screen reader. For this example, hide the SVG with aria-hidden="true"
and do not set a title
.
<div class="displayFlex flexAlignItemsCenter">
<svg class="textDarkestGray marginRight10" height="40px" width="40px" aria-hidden="true"><use xlink:href="#svgIcon-phone"></use></svg>
<a href="#" class="darkestLink">Call Us Now!</a>
</div>
Linked Icon, No Text
For linked icons that are not paired with text, we can use aria-label
on the <a>
element to provide descriptive, alternative text. IMPORTANT When using an icon as a link, you must give the <a>
a class (ie inlineMiddle) to make it a block element.
<a href="#" aria-label="Call Us Now!" class="darkestLink">
<svg height="40px" width="40px" focusable="false" aria-hidden="true"><use xlink:href="#svgIcon-phone"></use></svg>
</a>
Linked Icon, with Static Text
Again, for linked icons that are paired with text, let’s use aria-label on the <a>
element to provide descriptive, alternative text. With aria-label
on the <a>
tag, the screen reader does not announce the text inside of the link. IMPORTANT When using an icon as a link, you must give the <a>
a class (ie inlineMiddle) to make it a block element.
<a href="#" aria-label="Call Us Now!" class="darkestLink noLine displayFlex flexAlignItemsCenter">
<svg class="marginRight10" height="40px" width="40px" focusable="false" aria-hidden="true"><use xlink:href="#svgIcon-phone"></use></svg>
<span>Call Us Now!</span>
</a>
Notes
ALWAYS set the height
and width
on the svg
.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Logo Icons
4imprint Logos
Examples
Admin site use only
<svg class="textBlue" height="40px" width="40px" role="img" aria-label="Four Icon"><use xlink:href="#svgIcon-four"></use></svg>
<svg class="textBlue" height="53px" width="138px" role="img" aria-label="4imprint"><use xlink:href="#svgLogo-4imprint"></use></svg>
<svg height="55px" width="102px" role="img" aria-label="4imprint Outlet"><title>4imprint Outlet</title><use xlink:href="#svgLogo-outlet"></use></svg>
Code
<svg class="textBlue" height="53px" width="138px" role="img" aria-label="4imprint"><use xlink:href="#svgLogo-4imprint"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Flag Icons
World Flags
Flags to represent the 4imprint locales.
Examples
Admin site use only
<svg height="19px" width="29px" role="img" aria-label="Canada Flag"><use xlink:href="#svgIcon-caFlag"></use></svg>
Admin site use only
<svg height="19px" width="29px" role="img" aria-label="Ireland Flag"><use xlink:href="#svgIcon-ieFlag"></use></svg>
Admin site use only
<svg height="19px" width="29px" role="img" aria-label="UK Flag"><use xlink:href="#svgIcon-ukFlag"></use></svg>
Admin site use only
<svg height="19px" width="29px" role="img" aria-label="US Flag"><use xlink:href="#svgIcon-usFlag"></use></svg>
Code
<svg height="19px" width="29px" role="img" aria-label="US Flag"><use xlink:href="#svgIcon-usFlag"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Header/Account Icons
Header/Account
Examples
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Main Menu"><use xlink:href="#svgIcon-menuLines"></use></svg>
<svg class="textDarkestGray" height="45px" width="45px" role="img" aria-label="My Account"><use xlink:href="#svgIcon-account"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Cart"><use xlink:href="#svgIcon-cart"></use> </svg>
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="CVV"><use xlink:href="#svgIcon-cvv"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Social Icons
Social Media
Used to represent 4imprint's social media accounts.
Examples
<svg height="40px" width="40px" role="img" aria-label="Facebook"><use xlink:href="#svgIcon-facebook"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="Twitter"><use xlink:href="#svgIcon-twitter"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="LinkedIn"><use xlink:href="#svgIcon-linkedIn"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="Instagram"><use xlink:href="#svgIcon-instagram"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="YouTube"><use xlink:href="#svgIcon-youTube"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="Pinterest"><use xlink:href="#svgIcon-pinterest"></use></svg>
Code
<svg height="40px" width="40px" role="img" aria-label="Twitter"><use xlink:href="#svgIcon-twitter"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Better Choices® Icons
Better Choices® (SM in Canada)
The Better Choices Logo.
Colors:
Green: #4F712A
Blue: #02458b
Examples
<svg height="32px" width="102px" role="img" aria-label="Better Choices"><title>Better Choices</title><use xlink:href="#svgLogo-betterChoices"></use></svg>
<svg height="40px" width="49px" role="img" focusable="false" aria-label="Better Choices Icon"><title>Better Choices Icon</title><use xlink:href="#svgIcon-betterChoices"></use></svg>
Code
<svg height="32px" width="102px" role="img" aria-label="Better Choices"><title>Better Choices</title><use xlink:href="#svgLogo-betterChoices"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Favorite Board Icons
Favorite Boards
Examples
<svg class="textRed" height="40px" width="40px"><use xlink:href="#svgIcon-heartOutline"></use></svg>
<svg class="textLtGray" height="40px" width="40px"><use xlink:href="#svgIcon-heartOutline"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Add Item to Board"><use xlink:href="#svgIcon-addtoBoard"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Create Board"><use xlink:href="#svgIcon-createBoard"></use></svg>
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Create Board"><use xlink:href="#svgIcon-createBoard"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Art Library Icons
Art Library
Examples
<svg height="40px" width="40px" role="img" aria-label="Art File"><use xlink:href="#svgIcon-artFile"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="View Larger"><use xlink:href="#svgIcon-viewLargerEye"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-threeDotMenu"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Artwork"><use xlink:href="#svgIcon-artwork"></use></svg>
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Artwork"><use xlink:href="#svgIcon-artwork"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Search Icons
Search
Examples
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Search this Term"><use xlink:href="#svgIcon-searchArrow"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Contact Icons
Contact
Examples
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Call 4imprint"><use xlink:href="#svgIcon-phone"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Email"><use xlink:href="#svgIcon-email"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-bubble"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-comment"></use></svg>
Code
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-comment"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Arrow Icons
Arrows
Examples
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-arrowLine"></use></svg>
<svg class="textDarkestGray rotate90" height="40px" width="40px"><use xlink:href="#svgIcon-arrowLine"></use></svg>
<svg class="textDarkestGray rotate180" height="40px" width="40px"><use xlink:href="#svgIcon-arrowLine"></use> </svg>
<svg class="textDarkestGray rotate270" height="40px" width="40px"><use xlink:href="#svgIcon-arrowLine"></use> </svg>
<svg class="textDarkestGray" height="40px" width="40px"><use xlink:href="#svgIcon-arrowSolid"></use></svg>
<svg class="textDarkestGray rotate90" height="40px" width="40px"><use xlink:href="#svgIcon-arrowSolid"></use></svg>
<svg class="textDarkestGray rotate180" height="40px" width="40px"><use xlink:href="#svgIcon-arrowSolid"></use></svg>
<svg class="textDarkestGray rotate270" height="40px" width="40px"><use xlink:href="#svgIcon-arrowSolid"></use></svg>
Code
<svg class="textDarkestGray rotate270" height="40px" width="40px"><use xlink:href="#svgIcon-arrowSolid"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Trash & Remove Icons
Trash & Remove
Trash icon used for deleting things (products from cart); Remove icon used for removing things (product colors).
Examples
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Trash"><use xlink:href="#svgIcon-trash"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Remove"><use xlink:href="#svgIcon-remove"></use></svg>
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Remove"><use xlink:href="#svgIcon-remove"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Close Icons
Close
Icon for closing windows/popups.
Examples
<svg class="show roundCorners3 padding5 margin10" height="15px" width="15px" focusable="false" role="img" aria-label="Close"><use xlink:href="#svgIcon-remove"></use></svg>
Code
<button id="buttonIDHere" class="closeIcon roundCorners3">
<svg class="show roundCorners3 padding5 margin10" height="15px" width="15px" focusable="false" role="img" aria-label="Label Here"><title>Title Here</title><use xlink:href="#svgIcon-remove"></use></svg>
</button>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Hint Icons
Hints
Icons that provide a tooltip or information that shouldn't be missed.
Examples
<svg class="textYellow" height="40px" width="40px" role="img" aria-label="Hint"><use xlink:href="#svgIcon-hint"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Tooltip"><use xlink:href="#svgIcon-tooltip"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="CVV"><use xlink:href="#svgIcon-cvv"></use></svg>
Code
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Tooltip"><use xlink:href="#svgIcon-tooltip"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Review Icons
Reviews & Ratings
Examples
<svg class="textDarkestGray" height="18px" width="18px" focusable="false" aria-hidden="true"><use xlink:href="#svgIcon-starSolid"></use></svg>
<svg class="textWhite" height="18px" width="18px" focusable="false" aria-hidden="true"><use xlink:href="#svgIcon-starSolid"></use></svg>
<svg class="bkgdBlue textWhite makeCircle" height="40px" width="40px" role="img" aria-label="Positive"><use xlink:href="#svgIcon-positive"></use></svg>
<svg class="bkgdDkRed textWhite makeCircle" height="40px" width="40px" role="img" aria-label="Negative"><use xlink:href="#svgIcon-negative"></use></svg>
Code
<svg class="textDarkestGray" height="18px" width="18px" focusable="false" aria-hidden="true"><use xlink:href="#svgIcon-starSolid"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.
Miscellaneous Icons
Miscellaneous
Examples
<svg class="textDarkestGray roundCorners8 bkgdGreen" height="40px" width="40px" role="img" aria-label="Checkmark"><use xlink:href="#svgIcon-checkMark"></use></svg>
<svg class="textDarkestGray roundCorners5 bkgdGreen" height="30px" width="30px" role="img" aria-label="Checkmark"><use xlink:href="#svgIcon-checkMark"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Checkmark"><use xlink:href="#svgIcon-checkMark"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Edit"><use xlink:href="#svgIcon-edit"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Positive"><use xlink:href="#svgIcon-positive"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Negative"><use xlink:href="#svgIcon-negative"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Pause"><use xlink:href="#svgIcon-pause"></use></svg>
<svg height="40px" width="40px" role="img" aria-label="Warning"><use xlink:href="#svgIcon-warning"></use></svg>
<svg class="textOrange" height="40px" width="40px" role="img" aria-label="Video"><use xlink:href="#svgIcon-watchVideo"></use></svg>
<svg class="textYellow" height="40px" width="40px" role="img" aria-label="Rotate"><use xlink:href="#svgIcon-rotate"></use></svg>
<svg class="textOrange" height="40px" width="40px" role="img" aria-label="RSS"><use xlink:href="#svgIcon-rss"></use></svg>
<svg class="textDarkestGray" height="40px" width="40px" role="img" aria-label="Thumbs Up"><use xlink:href="#svgIcon-thumbsUp"></use></svg>
Code
<svg height="40px" width="40px" role="img" aria-label="Warning"><use xlink:href="#svgIcon-warning"></use></svg>
Notes
None at this time.
Resources
Sass File(s) | None |
---|---|
JS File(s) | None Required |
JS Functions | None |
Locale Keys | None |
Accessibility
None at this time.