Skip to content

121cast/boomsvgloader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#BoomSVGLoader

BoomSVGLoader is an AJAX solution for your SVG sprite.

This plugin simply loads your compiled SVG sprite into the page immediately after the opening <body> tag. The SVG sprite is wrapped in a visually hidden <div>. Original technique explained on CSS Tricks.

Simple Demo

Installation

There's a few options to get up and running with BoomSVGLoader:

  • Download the latest release
  • Clone the repo, git clone git://github.com/boomtownroi/boomsvgloader.git
  • Install with Bower: bower install boomsvgloader --save
  • Install with npm: npm install boomsvgloader

Usage

  1. BoomSVGLoader JS files are in the dist/ folder. Either add it to your script bundle build process or load it directly in the page.

    <script src='js/boomsvgloader.min.js'></script>

  2. Call BoomSVGLoader's load function with the path to your SVG sprite.

    boomsvgloader.load('/path/to/your/sprite.svg')

  3. Use your SVGs! The name after the # should match a symbol ID inside of your SVG sprite.

    <svg><use xlink:href="#heart"/></svg>

Versioning

BoomSVGLoader is maintained by using the Semantic Versioning Specification (SemVer)

Copyright and License

Copyright 2015 BoomTown under the MIT License