
Description
react-sketch is a sketch field component for React applications, built on fabric.js. Users can draw with a pencil, add lines, arrows, rectangles and circles, select and move objects, add images and text, and undo and redo their changes. A drawing can be exported as JSON or as an image. The package includes TypeScript declarations, and all of its types are available in a Types namespace. The main component, SketchField, is a class component, and its methods, such as undo and toJSON, are reached through a ref once it has mounted. You load a drawing either with defaultValue, which loads on mount, or with value, which loads when it changes to a new object. Drawings saved with version 0.5.x load in the current version, but drawings saved with 1.0.0 do not load in 0.5.x. React 17, 18 or 19 is a peer dependency that your app installs, while fabric is installed along with the package. The default export of 0.5.x still works. The project is public on GitHub and is published to npm.…
Highlights
- Pencil, lines, arrows, rectangles and circles
- Select, move, add images and text
- Undo and redo
- Export as JSON or as an image
- TypeScript declarations included
Ratings & Reviews
No ratings yet
Be the first to rate react-sketch.
People also visit

react-sketch-canvas
Freehand vector drawing component for React using SVG as canvas

react-konva
React Konva is a JavaScript library for drawing complex canvas graphics

react-rough-notation
This is a React wrapper for [RoughNotation](https://roughnotation.com/)
react-sketch FAQ
What is react-sketch?
A sketch field component for React, built on fabric.js, that lets users draw, select and edit objects.
Which React versions does it support?
The README lists React 17, 18 and 19 as a peer dependency, which your app installs.
How do I save and load a drawing?
toJSON returns the drawing as an object. defaultValue and value accept that object, or the same object as a JSON string.
Does it include TypeScript types?
Yes. They are available in the Types namespace, for example Types.SketchProperties and Types.Tool.
Are older drawings compatible?
Drawings saved with 0.5.x load in the current version, but drawings saved with 1.0.0 do not load in 0.5.x.
What are the best react-sketch alternatives?
Popular alternatives to react-sketch include react-canvas-draw, react-sketch-canvas and react-signature-canvas. See all react-sketch alternatives
















