
Description
react-canvas-draw is a React component for drawing on a canvas, with a simple API and many options. The basic CanvasDraw component gives a white drawing surface, and props let you set a custom brush colour, a background image that is resized and centred to fit, and a background that refreshes on a timer. You can hide the interface or the grid, and enable mouse scrolling and panning with Ctrl, pinch zoom and two-finger panning. The clampLinesToDocument property keeps lines inside the canvas bounds. Drawings can be saved and loaded: the component can export its data, and load a saved drawing through the loadSaveData method or the saveData prop, and it scales the drawing to the current canvas size. A loadTimeOffset prop controls whether a loaded drawing appears instantly or is replayed over time. The demo page shows each option with a live example, including erase, undo, a data URL export and sliders for brush and lazy radius. The source of the examples is in the mBeierl/react-canvas-draw repository on GitHub. The demo page shows version 1.2.1.…
Highlights
- Drawing component with brush colour and lazy radius
- Background images that scale to fit the canvas
- Pinch zoom, panning and bounded lines
- Save and load drawings at any canvas size
Ratings & Reviews
No ratings yet
Be the first to rate react-canvas-draw.
People also visit

react-sketch-canvas
Freehand vector drawing component for React using SVG as canvas
react-canvas-draw FAQ
What is react-canvas-draw?
A simple React component for drawing on an HTML canvas, with options for brushes, backgrounds, zoom and saving drawings.
Can users save and load drawings?
Yes. You can load a saved drawing with the loadSaveData method or the saveData prop, and it scales to the current canvas size.
Can I use a background image?
Yes. Set the imgSrc prop and the image resizes to fit the canvas and is centred.
How does zooming work?
Set the enablePanAndZoom prop to allow mouse scrolling and panning with Ctrl, pinch zooming and two-finger panning.
Is it free?
Yes. The examples and source are on GitHub, so it is open source.
What are the best react-canvas-draw alternatives?
Popular alternatives to react-canvas-draw include react-sketch-canvas, react-sketch and react-sketch-canvas. See all react-canvas-draw alternatives

















