Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 896 Bytes

README.md

File metadata and controls

47 lines (35 loc) · 896 Bytes

react-native-sketchpad

react native sketchpad

  

Installation

npm install react-native-sketchpad

Usage

example

import Sketchpad, { SoftBrush, HardBrush } from "react-native-sketchpad";

// ...
function App() {
  const pad = useRef();
  const brush = new SoftBrush(3, 7);
  const onClear = () => {
    pad.current?.clear();
  };
  const onUndo = () => {
    pad.current?.undo();
  };
  const onSave = () => {
    pad.current?.toDataURL((base64) => {
      // do save image
    });
  };
  return (
    <Sketchpad ref={pad} style={styles.pad} brush={brush} />
  );
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT