react-hooks-svgdrawing
react-hooks-svgdrawing
is React drawing library. This library is a React extension of svg-drawing
Get started
yarn add react react-hooks-svgdrawing
How to use
This is example.
const Drawing = { const renderRef draw = // Drawing area will be resized to fit the rendering area return <div style= width: 500 height: 500 ref=renderRef />}
useSvgDrawing options.
const renderRef draw =
Drawing methods.
const renderRef draw = // Call the SvgDrawing. Access the current settings of penWidth, penColor etc// Details are https://github.com/kmkzt/svg-drawing.console // #333console // 1 // Erase all drawing.drawclear // Download image.draw // default svg downloaddrawdrawdraw // Undo drawing.draw // Change pen configdraw// Change pen widthdraw// Change fill attribure of svg path element.draw// Change throttle delay of drawingdraw// Set whether to use curved comma for svg path element.draw// Set whether to use curved comma for svg path element.draw // get svgXML// return SVGElementconsole // <svg width="502" height="502"><path stroke-width="3" stroke="#000" fill="none" stroke-linejoin="round" stroke-linecap="round" d="M 156.671875 284.7265625 C 156.671875 286.1465625 156.671875 287.89984375 156.671875 291.83984375 ...