This method creates a new item collection and returns the available methods for it. See all available options.
.add(name, content, options)
This method adds an item to the collection. Using the last argument you can transfer individual settings for that item (e.g. attributes). See all available options.
.get(name)
Returns the contents of a specified element.
.remove(name)
Removes the specified item from the collection.
.clean()
Removes all elements in the collection.
.compile()
Returns the builded sprite.
Supported options
rootAttributes
Type: Object
Default: {}
The attributes that will be added to the root svg tag.
inline
Type: Boolean
Default: false
If you want to embed the sprite into your HTML source, you will want to set this to true in order to prevent the creation of SVG namespace declarations and to set some other attributes for effectively hiding the library sprite.
iconAttributes
Type: Object
Default: {}
The attributes of each icon. Current attribute values will be overwritten.
iconPrefix
Type: String
Default: ''
The name prefix for each icon.
iconSuffix
Type: String
Default: ''
The name suffix for each icon.
clean.stripEmptyTags
Type: Boolean
Default: true
Removes empty tags such as <defs></defs> or <g></g>.
clean.stripTags
Type: Array
Default: ['title', 'desc']
Removes tags, that are listed in this list.
clean.stripAttrs
Type: Array
Default: []
Removes attributes, that are listed in this list.
If you specify a string, then use the strict comparison. You can also specify the object and the type of comparison.