About Konva.js - Open-Source HTML5 Canvas JavaScript Framework
About Konva.js
Konva.js is an open-source 2D HTML5 Canvas JavaScript framework. It provides an object-oriented API for interactive canvas applications. It supports shapes, animations, events, drag-and-drop, filters, serialization, and high-quality exports. Konva has integrations for React, Vue, Svelte, and Angular. It uses the MIT license and has been maintained since 2015.
Key Facts
| Created | 2015 (forked from KineticJS, which started in 2012) |
| Creator | Anton Lavrenov |
| License | MIT (free for commercial and personal use) |
| Language | JavaScript and TypeScript (built-in type definitions) |
| npm package | konva |
| GitHub | github.com/konvajs/konva |
| Website | konvajs.org |
| Community | Discord, Stack Overflow (konvajs) |
Framework Integrations
Konva has official bindings for all major JavaScript frameworks:
| Framework | Package | Install |
|---|---|---|
| React | react-konva | npm install react-konva konva |
| Vue | vue-konva | npm install vue-konva konva |
| Svelte | svelte-konva | npm install svelte-konva konva |
| Angular | ng2-konva | npm install ng2-konva konva |
Who Uses Konva
Konva is used by teams worldwide, including:
- Meta — Facebook/Instagram
- Microsoft
- Labelbox — AI data labeling platform
- Zazzle — Custom product design
- Polotno — Design editor SDK built on top of Konva
Open-source projects that declare Konva in their public package.json:
- peaks.js — the BBC's audio waveform editor
- Label Studio — data labeling platform
- Weave.js — Inditex's collaborative canvas
- DWV — DICOM medical image viewer
And thousands of other companies and individual developers building design editors, annotation tools, whiteboard apps, interactive maps, data visualizations, games, and more.
Architecture
Konva uses a hierarchical node structure:
Stage (one per canvas area)
└── Layer (each layer is a separate <canvas> element)
└── Group (optional, for organizing shapes)
└── Shape (Rect, Circle, Text, Image, Line, etc.)
- Stage: The root container, attached to a DOM element. Contains one or more Layers.
- Layer: Each Layer is a separate
<canvas>element with its own scene and hit-detection canvas. Use multiple Layers to optimize rendering. - Group: An optional container for organizing and transforming multiple Shapes together.
- Shape: A visual element — Rect, Circle, Ellipse, Line, Arrow, Text, Image, Path, Star, Ring, Arc, RegularPolygon, Wedge, Sprite, TextPath, Label, and custom shapes.
Core Capabilities
- Shapes: Rect, Circle, Ellipse, Line, Arrow, Arc, Ring, Wedge, Star, RegularPolygon, Path, Text, TextPath, Image, Sprite, Label, and custom shapes
- Event System: Click, double-click, mouseover, mouseout, touchstart, touchmove, tap, drag events with bubbling and delegation
- Drag and Drop: Built-in drag-and-drop with boundaries, snapping, and drop events
- Animations: Frame-based animations via
Konva.Animationand property tweens viaKonva.Tweenwith 30+ easing functions - Filters: Blur, Brightness, Contrast, Grayscale, HSL, Invert, Noise, Pixelate, Sepia, Threshold, and custom filters
- Serialization: Save and restore the node tree and its serializable attributes with
toJSON()andKonva.Node.create(). Restore images, event handlers, and custom drawing functions separately. - Export: High-quality image export via
toDataURL()andtoBlob()(PNG, JPEG), PDF export via third-party libraries - Select and Transform: Built-in
Transformerfor interactive resize, rotate, and scale - Performance: Layer-based rendering, shape caching, and optimization APIs for handling thousands of shapes
- Cross-Platform: Works on desktop and mobile browsers with full touch event support
- Node.js: Server-side canvas rendering via the
canvasnpm package - TypeScript: Built-in TypeScript type definitions
Links
- Getting Started Tutorial
- Why Konva? — When to Use Konva
- API Reference
- Interactive Demos
- FAQ — Frequently Asked Questions
- Best Canvas Libraries — Comparison Guide
- GitHub Repository
- npm Package
- Changelog
- Discord Community
- Stack Overflow
"Made with Konva" Badge
Add this badge to your project README to show it's built with Konva:
[](https://konvajs.org)