π¨ @darthrapid/react-native-simple-canvas v1.0.0
Release of a lightweight, SVG-based drawing canvas for React Native.
Features
- Freehand drawing β smooth touch-based drawing using PanResponder and react-native-svg
- Undo / Redo β full stroke history management via ref API
- Manual capture β save canvas as JPG/PNG image on demand with
capture() - Auto-capture β optional debounced capture after every stroke
- Customizable strokes β color, width, line cap, line join β all configurable via props and changeable on the fly
- Background color β fully customizable canvas background
- Initial image β display a previously saved drawing (e.g. in multistep forms), hidden once user starts drawing
- Disabled state β block touch input during capture or other async operations
- Stroke serialization β
getStrokes()/setStrokes()for saving and restoring drawings - Lifecycle callbacks β
onStrokeStart,onStrokeEnd,onStrokesChange - Zero native code β pure JS/TS library, works with Expo out of the box
Peer Dependencies
react>= 18react-native>= 0.72react-native-svg>= 15react-native-view-shot>= 4