SVG icon microservice
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit c7773af Apr 5, 2017
Permalink
Failed to load latest commit information.
docs Update links Oct 17, 2016
lib Move things Apr 5, 2017
server Fix icon count Apr 5, 2017
.babelrc Lazy load icon list Oct 28, 2016
.gitignore Move things Apr 5, 2017
.npmignore Move server files Apr 5, 2017
README.md Edit readme Apr 5, 2017
build.js Move things Apr 5, 2017
index.js Move things Apr 5, 2017
package.json Adjust now config Apr 5, 2017
webpack.config.js Move server files Apr 5, 2017

README.md

microicon

SVG icon microservice and node module

Includes over 1200 icons from Material Design, Reline, Geomicons, and Simple Icons

Usage

https://icon.now.sh/chevron

Size

https://icon.now.sh/chevron/32

Color

https://icon.now.sh/chevron/ff0000

Direction

(Only for directional icons)

https://icon.now.sh/chevron/down

Stroke width

(Only for Reline icons)

https://icon.now.sh/chevron/?strokeWidth=1

Node.js Usage

npm install microicon
const paths = require('microicon')

const svg = `
<svg viewBox='0 0 32 32'
  width='32'
  height='32'
  fill='currentcolor'>
  <path d='${paths.heart}' />
</svg>
`

Note: the paths object is quite large and it is not recommended for use in client side scripts. Consider using a build step to extract the subset of icons that you need.

React Component

const React = require('react')
const { Icon } = require('microicon')

module.exports = () => (
  <div>
    <Icon name='heart' size={32} color='tomato' />
  </div>
)

MIT License