
Description
React Sketch Canvas is a React component for freehand drawing. It draws on an SVG canvas, so each stroke is stored as a vector shape rather than as pixels. It accepts input from a mouse, touch screens and graphic tablets, and it works on desktop and mobile browsers. You can set the stroke color and width, the eraser width, the canvas color and a background image, and you can choose which pointer types are allowed. The component requires React 18.0.0 or later. You install it with npm or pnpm, add the component to your app, and use a ref to export the sketch as a data URL. Props include width, height, an id for pages with several canvases and a class name for CSS selectors. The README contains a table of every prop with its type and default value, and it links to a test page where you can try the canvas before you install it. It is useful for note taking, signatures, annotations and simple drawing features in React apps.…
Highlights
- Freehand drawing on an SVG canvas
- Mouse, touch and graphic tablet input
- Configurable stroke, eraser and background
- Export a sketch as a data URL
- Requires React 18.0.0 or later
Ratings & Reviews
No ratings yet
Be the first to rate react-sketch-canvas.
People also visit
react-sketch-canvas FAQ
What is React Sketch Canvas?
A React component that lets users draw freehand on an SVG canvas.
How do I install it?
Install it with npm or pnpm, then add the component to your React app. The README has a common usage example.
Can I export the drawing?
Yes. Use a ref to export the sketch as a data URL, as shown in the README.
Which React version is needed?
React 18.0.0 or later.
What are the best react-sketch-canvas alternatives?
Popular alternatives to react-sketch-canvas include react-sketch, react-sketch-canvas and react-svg-pan-zoom. See all react-sketch-canvas alternatives
















