8 Best Free Libraries For SVG

8 Best Free Libraries For SVG

All modern browsers support the SVG filetype and it’s quickly becoming a favored choice among web designers.

You can design beautiful icons as SVGs and scale them to any size without quality loss. This is one of the biggest benefits of the SVG format considering retina displays are on the rise.

If you’d like to animate or manipulate your SVGs that’ll take a little more work. But these free libraries offer the best tools for the job if you’re willing to roll up your sleeves and get your hands dirty in some code.

1. SVG.js

The first library I have to recommend is SVG.js. Naturally this is totally free and open sourced for use in any type of web project.

It’s very lightweight totaling only 16KB when gzipped and about 62KB minified. Granted this is pretty large as a whole, but compared to similar libraries it’s on the smaller side.

Installation is pretty simple with support for npm and a whole page dedicated to getting started.

Each page in the documentation has plenty of JS and HTML codes for you to look through and get started. Plus you can find embedded demos hosted on JSFiddle to see how this library works in action.

01-svgjs-homepage

2. Snap.svg

Another popular SVG library is Snap.svg. It’s a JavaScript library with zero dependencies and a fairly large support community running through websites like Slack.

Currently the project is in v0.5.1 so it’s got a long ways to go before a full v1.0 release.

I would still consider this ready for commercial use since it’s been tested heavily for bugs in each release and built to work across any type of SVG. This includes exported files from Illustrator, InkScape, or hard-coded SVGs in your HTML.

Have a look at the demos page for a taste of what Snap can do.

02-snap-svg-homepage

3. Bonsai.js

For a more general graphics library I highly recommend Bonsai.js. It’s been around for years and it’s one of the more well-maintained projects with a core group of supporters.

This lets you build some pretty cool stuff with SVGs and the canvas element. You can design little icons for landing pages or more complex graphs like pie charts.

Not to mention you get full control over paths in SVGs along with animation effects using keyframes in the Bonsai library.

Take a peek at the examples page for a few live demos and visit the online docs to get started with your first Bonsai graphics.

03-bonsai-js-script

4. Paper.js

Paper.js calls itself the Swiss Army knife of vector graphics scripting. And in many ways this is right on the money.

By default Paper.js works on top of HTML5 canvas elements with its own DOM model to manipulate. You can edit bezier curves right inside the code which gives you far more control with even basic scripting.

Have a look at their examples page if you’re curious to see this in action.

I’d say this is more of a canvas manipulation library than just a custom animation or SVG library. But it’s definitely powerful and a great choice for anyone getting into SVGs for the web.

04-paperjs-script-homepage

5. Raphaël

Here’s a classic JS library for graphics manipulation and SVG scripting. Raphaël is totally free under the MIT License and available on GitHub for download.

As of this writing it’s currently in v2.2.1 and has a pretty large base of contributors. All of the code runs in plain JavaScript but that can include TypeScript if you prefer faster coding.

Each graphic on the page gets its own DOM section and can be manipulated just like a DOM element. Custom functions in Raphaël make this a great library for beginners just learning the ropes of HTML5 canvas.

There’s also quite a few crazy demos if you dig through the main site.

05-raphael-example-graph

6. Two.js

The open source Two.js script is a custom 2D drawing API built in JavaScript.

This is not meant for just canvas elements although it does work best for those types of layouts. But you can use Two.js for manipulating a few common formats on the web: SVG, Canvas, and WebGL.

I would say Two.js has a steeper learning curve for someone who’s not super familiar with JavaScript. This is because you can do so much with this library and the features can seem endless.

But one look over the examples page and you’ll get an idea of how much is possible.

06-twojs-example-demo

7. Velocity.js

Technically the Velocity.js library is a free animation library, however it does support SVGs making it a fantastic choice for all UI/UX animation.

You can also run Velocity with jQuery or on its own using vanilla JS.

If you look through the main page you’ll find all the setup info you need along with documentation for each type of animation. Most of them even have demos on CodePen so you can see how they work in the browser.

Stick to Velocity if you’re looking to create practical animations for a website. I specifically recommend it for basic page UX motion or more complex microinteractions.

07-velocity-js-script-homepage

8. Vivus.js

With Vivus.js you can build one very specific type of animation: the drawn outline effect.

You see this with SVG images all the time. An SVG path can be animated into view one point at a time so it looks like the entire graphic is being drawn by hand.

This is a really neat effect and with Vivus it’s super easy to setup. Granted this doesn’t radically improve the user experience or increase usability, but it is a really fun library to work with.

Especially if you’re brand new to SVGs and you want an easy JS library to play with for testing.

08-vivus-js-homepage

Fancy you stumbling on my piece of the internet. Bonjour!

My name is Anmol and I'm the Blogger-In-Chief of this joint & working as the Chief Technology Officer at Azoora, Inc. I'm putting up my views here trying to help creative solopreneurs, developers & designers build their business using the power of websites, apps & social media, this, is, my jam.

If you're looking to start your own online business with a professional high quality website or mobile app, just get in touch. I'd be more than happy to assist.

SKYPE | FACEBOOK | LINKEDIN | TWITTER | EMAIL

20 comments

  1. Valentina tek says:

    Ищу хорошего IT специалиста.Требуется сделать лендинг страницу по товарке под ключ.Дизайн, верстка, вордпресс, хостинг и тд. Либо скопировать. ссылка

  2. Anonymous says:

    Hey! I know this is kind of off topic but I was wondering which blog platform are you using
    for this site? I’m getting sick and tired of WordPress because I’ve had
    problems with hackers and I’m looking at alternatives for another platform.
    I would be great if you could point me in the direction of a good platform.

  3. Anonymous says:

    I like the helpful info you provide in your articles. I will bookmark your blog and visit again here frequently.
    I’m relatively sure I will be told a lot of new stuff proper here!

    Good luck for the next!

  4. Anonymous says:

    Hi there I am so glad I found your website, I really found you by accident, while
    I was researching on Google for something else, Regardless I am here now and would just like to say thanks
    for a marvelous post and a all round interesting blog (I also love
    the theme/design), I don’t have time to read through
    it all at the minute but I have bookmarked it and also included your RSS feeds, so when I have time I will be back to read more,
    Please do keep up the superb work.

  5. Anonymous says:

    you are in point of fact a just right webmaster. The site loading velocity is
    incredible. It seems that you’re doing any unique trick.
    Furthermore, The contents are masterwork. you have performed a magnificent
    task on this matter!

  6. Having read this I believed it was really enlightening.
    I appreciate you taking the time and effort to put this informative article together.
    I once again find myself personally spending a lot of
    time both reading and leaving comments. But so what, it was still worthwhile!

  7. Anonymous says:

    This is really interesting, You are a very skilled blogger.
    I have joined your rss feed and look forward to seeking more of your fantastic
    post. Also, I have shared your website in my social networks!

  8. Terrence Trevino says:

    This blog was… how do you say it? Relevant!! Finally I’ve found something which helped me.
    Thanks!

  9. Gerard Bartman says:

    I was studying some of your blog posts on this website and I think this site is real instructive! Retain putting up.

  10. It’s actually a nice and useful piece of information. I’m satisfied that you simply shared this useful info with us.
    Please stay us informed like this. Thank you for sharing.

Leave a Reply to Anmol Dubey Cancel reply

Your email address will not be published.