konvajs/konva

Public

Konva.js is an HTML5 Canvas JavaScript framework for interactive graphics, design editors, whiteboards, and diagrams. Scene graph with events, drag and drop, transforms, animations, and export.

  • Stars14.9k+18 tuần này
  • Forks1.1k
  • Watchers167
  • Issues1
  • Ngày tạo09/01/2015
  • Cập nhật gần nhất24/10/2026
  • Ngôn ngữTypeScript
  • Giấy phép—
README.md27.5 KBRaw

Konva logo

Konva

Build interactive graphics, editors, and diagrams for the web.

npm downloads npm version Financial Contributors on Open Collective Build Status Build Status CDNJS version

Konva is an open-source 2D canvas framework for interactive graphics. Its scene graph gives each shape its own events, drag behavior, transforms, animation, cache, and export controls.

Use Konva for design editors, whiteboards, diagrams, annotations, maps, and other visual tools. Konva is MIT licensed and does not require a license key.

This repository began as a GitHub fork of ericdrowell/KineticJS.

A Konva Transformer around a selected image

Framework integrations

Framework Package Documentation
React react-konva React guide
Vue vue-konva Vue guide
Svelte svelte-konva Svelte guide
Angular ng2-konva Angular guide

Quick Look

import Konva from 'konva';

const container = document.createElement('div');
document.body.appendChild(container);

const stage = new Konva.Stage({ container, width: 600, height: 400 });
const layer = new Konva.Layer();
const box = new Konva.Rect({
  x: 50,
  y: 50,
  width: 120,
  height: 80,
  fill: '#00a8e8',
  draggable: true,
});

layer.add(box);
stage.add(layer);

Building a full design editor? Polotno is a commercial design editor SDK built on Konva by the Konva maintainers. It ships templates, text editing, and export, so you integrate an editor instead of building one: npm install polotno.

Browsers support

Konva works in modern mobile and desktop browsers that support ES2018.

Debugging

The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool.

Loading and installing Konva

Konva supports UMD loading. So you can use all possible variants to load the framework into your project:

Nội dung README thuộc về konvajs và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/konvajs/konva