Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
This is a good video if you'd like to use the html canvas. You can use this library to get reactive mouse coordinate offsets. When setting canvas width and height, you may also need to call getBoundingClientRect if you notice a difference between your set width and the true width displayed in chrome devtools.
You might want to check out tldraw - project to render react on canvas and whiteboard application built on it. And subscribe to Steve Ruiz as he writes about such (and more complex freehand) drawings.