Rough.js — screenshot of roughjs.com

Rough.js

Rough.js is a JavaScript library for generating vector graphics with a distinctive hand-drawn, sketchy aesthetic. It's a lightweight option for adding an organic feel to web-based visualisations or diagrams.

Visit roughjs.com →

Questions & Answers

What is Rough.js?
Rough.js is a lightweight JavaScript graphics library (<9kB gzipped) that enables drawing various shapes and SVG paths with a distinctive hand-drawn, sketchy appearance. It supports both HTML Canvas and SVG rendering contexts.
Who would benefit from using Rough.js?
Designers and developers looking to add a non-perfect, organic, or "sketched" aesthetic to their web graphics, diagrams, or user interfaces will find Rough.js useful. It's suitable for projects where a polished, precise look is not desired.
How does Rough.js compare to standard graphics libraries like D3.js or Konva?
Unlike traditional graphics libraries that aim for precise, clean vector rendering, Rough.js specializes in applying a "sketchy" style to its output. Its primary differentiation is this unique hand-drawn aesthetic rather than comprehensive feature sets for complex data visualization or animation.
In what scenarios is Rough.js particularly useful?
Rough.js is ideal for creating wireframes, mockups, educational diagrams, or any web application where a more informal, "work-in-progress" or artisanal look is desired. It can also be used to add unique styling to existing SVG graphics.
What drawing primitives does Rough.js support and how does it handle fill styles?
Rough.js supports primitives like lines, curves, arcs, polygons, circles, and ellipses, as well as general SVG paths. It offers various fill styles including hachure (default), solid, zigzag, cross-hatch, dots, sunburst, dashed, and zigzag-line, with customizable parameters like hachureAngle and hachureGap.