react-native-sketchpad
v1.0.1
Published
react native sketchpad
Downloads
6
Readme
react-native-sketchpad
react native sketchpad
Installation
npm install react-native-sketchpad
Usage
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