A renderer-agnostic 2D drawing API for the web that draws the same scene with WebGL, Canvas 2D, or SVG.
paperjs/paper.js
Paper.js is a JavaScript vector graphics scripting library that draws and manipulates paths on HTML5 Canvas in the browser or Node.js.
- Stars
- 15,190
- Forks
- 1,261
- Open issues
- 27
- Last commit
- 10 hours ago
What is it?
Paper.js is a JavaScript port of Scriptographer, a vector graphics scripting tool. It provides a scene graph of paths, shapes, text, groups and symbols, and lets you create and transform them programmatically on an HTML5 Canvas element.
The library is distributed on NPM as `paper` for browsers and bundlers, with a core build that omits PaperScript support. Companion packages `paper-jsdom` and `paper-jsdom-canvas` allow headless use in Node.js, with SVG import and export through jsdom and canvas rendering through node-canvas, which requires Cairo and Pango.
The project is built with Gulp and pnpm, and tests run on Vitest and Playwright. Prebuilt development versions of the develop branch are published on dedicated branches.
Key features
- 01Scene graph of paths, shapes, text, groups and symbols on Canvas.
- 02Path editing operations such as boolean combination and transformation.
- 03PaperScript support in the full browser build.
- 04SVG import and export in Node.js via jsdom.
- 05Canvas rendering in Node.js via node-canvas.
Use cases
- Building interactive vector drawings or animations in the browser.
- Generating or processing SVG graphics in a Node.js server script.
- Creating canvas-based editors or diagram tools.
Quick start
- 1
Install Paper.js from NPM in your project folder
npm install paper - 2
Import it with a bundler and call paper.setup() on a canvas element
Things to know
- The license is not detected in the project metadata, so check the repository's license before using it.
- Canvas rendering in Node.js (paper-jsdom-canvas) needs native Cairo and Pango libraries installed first.
Topics
FAQ
- What is paper.js?
- Paper.js is a JavaScript vector graphics scripting library that draws and manipulates paths on HTML5 Canvas in the browser or Node.js. Paper.js is a JavaScript port of Scriptographer, a vector graphics scripting tool. It provides a scene graph of paths, shapes, text, groups and symbols, and lets you create and transform them programmatically on an HTML5 Canvas element.
- Is paper.js free to use? What license does it have?
- paper.js is open source under the Other license. Check the license terms before using it in commercial products.
- Is paper.js still maintained?
- Actively maintained. The last commit to paper.js was on Nov 6, 2026.
- What can I use paper.js for?
- Building interactive vector drawings or animations in the browser. Generating or processing SVG graphics in a Node.js server script. Creating canvas-based editors or diagram tools.
- How do I install paper.js?
- Install Paper.js from NPM in your project folder: npm install paper Import it with a bundler and call paper.setup() on a canvas element
- Where can I get paper.js?
- The source code and installation instructions are on GitHub: https://github.com/paperjs/paper.js
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An open-source vector illustration app written from scratch in pure Rust, running on desktop, FreeBSD and in the browser via WebAssembly.
An HTML5 Canvas JavaScript framework for building interactive 2D graphics, design editors, whiteboards and diagrams.
A lightweight JavaScript animation library that animates CSS properties, SVG, DOM attributes and plain JavaScript objects.
A JavaScript motion graphics library for the web, offering declarative shape, swirl, burst and stagger animations.
A Claude Code skill that turns a short theme into a beat-synced motion graphics video rendered to MP4 with HyperFrames.