<p align="center"> <img alt="SVG Spreact" title="SVG Spreact" src="https://cdn.rawgit.com/elrumordelaluz/svg-spreact/2b58118b/logo.svg" width="450"> </p>
npm install svg-spreact
Create an SVG Sprites using svgson and react
``zsh`
yarn add svg-spreact
`
const svgSpreact = require('svg-spreact')
const icons = [
,
]
svgSpreact(icons).then(({ defs, refs }) => {
console.log(defs) //
console.log(refs) //
svgSpreact(input, [options])
#### input
Type: Array
#### options
Type: Object
* tidy output prettyfied (Boolean) default: trueoptimize
* output optimizde with svgo (Boolean) default: truesvgoConfig
* _SVGO_ plugins configuration (Object) defaultprocessId
* function for customize _Icons_ ids (Function) default: (n) => 'Icon_' + nclassName
* classname/s to add on each
Take a look into this example reading a folder with _Icons_
svg-spreact-cli CLI version