Getting started with React and Canvas via Konva

react-konva
is a JavaScript library for drawing complex canvas graphics using React. It provides declarative and reactive bindings to the Konva Framework.
It is an attempt to make React work with the HTML5 canvas library. The goal is to have a similar declarative markup as normal React and also a similar data-flow model.
Currently, react-konva
is not supported in the React Native environment.
Currently you can use all Konva
nodes and shapes as React components and all Konva
events are supported on them in the same way.
Note: you can find a lot of demos and examples for using Konva at https://konvajs.org/. Really, just go there and take a look at what Konva can do for you. You will be able to do the same with react-konva, too. Konva
for react-konva
is like DOM for React
.
Installation
npm install react-konva konva --save
Here's a basic example showing how to create a simple canvas with some shapes: