React Canvas Library — Getting Started with react-konva

react-konva is the most popular React canvas library for drawing complex 2D graphics. It provides declarative and reactive bindings to the Konva Framework, letting you build interactive canvas applications using familiar React components and data flow.
With react-konva you write canvas graphics the same way you write React DOM — with JSX components, props, state, and hooks. Every Konva shape (Rect, Circle, Line, Text, Image, Star, and more) is available as a React component with full event support.
Note: react-konva works in the browser only and is not supported in React Native.
You can find dozens of interactive demos at konvajs.org — everything Konva can do, react-konva can do with React. Think of it as: Konva is to react-konva what the DOM is to React.
Installation
npm install react-konva konva --save
Here's a basic example showing how to create a simple canvas with some shapes: