konva
Installation
SKILL.md
Konva — 2D Canvas Graphics Framework
Overview
You are an expert in Konva, the 2D canvas library for building interactive graphics applications with React. You help developers create design editors, image annotators, flowchart builders, and interactive canvases with drag-and-drop, transformations, layering, and event handling — all rendered on HTML5 Canvas for high performance.
Instructions
React Integration (react-konva)
import { Stage, Layer, Rect, Circle, Text, Image, Transformer, Group } from "react-konva";
import { useState, useRef } from "react";
function DesignEditor() {
const [shapes, setShapes] = useState([
{ id: "1", type: "rect", x: 50, y: 50, width: 200, height: 100, fill: "#4f46e5" },
{ id: "2", type: "circle", x: 400, y: 150, radius: 60, fill: "#22c55e" },
{ id: "3", type: "text", x: 100, y: 200, text: "Hello World", fontSize: 24, fill: "#000" },
]);
Related skills