A lightweight library for manipulating and animating SVG.

      
        // create svg drawing paper
        var draw = SVG('canvas')

        // create image
        var image = draw.image('images/shade.jpg')
        image.size(600, 600).y(-150)

        // create text
        var text = draw.text('SVG.JS')
        text.move(300, 40).fill('#fff')
        text.font({
          family: 'Source Sans Pro'
        , size: 180
        , anchor: 'middle'
        , leading: 1
        })

        // clip image with text
        image.clipWith(text)
      
    
The code above is the the exact same code used to create the masked header at the top of this page. With svg.js you have all the power of vector graphics at pocket size. The whole library is a about 7k gzipped. Are you intrigued? Have a look on github, browse through the documentation to learn more, or see it in action!

Tweet

Not convinced yet? Here are a few highlights:

Downloads

svg.js v0.15 (for development) - 55k uncompressed, lots of comments

svg.min.js v0.15 (for production) - 7.2k when gzipped

Fork me on GitHub