/react-native-canvas-view

React Native canvas drawing view for iOS

Primary LanguageObjective-CMIT LicenseMIT

@ankipro/react-native-canvas-view

React Native library for drawing on iOS, leveraging the power of Apple PencilKit to provide a seamless and immersive canvas drawing experience. Ideal for applications that require precise and natural drawing capabilities.

Key Features:

  • Versatile Drawing Tools: Choose from a variety of drawing tools, including brushes, pencils, erasers, and more.
  • Customizable Brushes: Customizable brush sizes, colors, and styles.
  • Undo/Redo Functionality
  • Save: Save your masterpieces in Base64 format.

canvas demo

Installation

yarn add @ankipro/react-native-canvas-view

... and pods

npx pod-install

Basic usage

import CanvasView from "@ankipro/react-native-canvas-view";

// ...

<CanvasView ref={canvasRef} />

For more information see example.

Props

Name Type Description
ref CanvasViewRef See methods below
style ViewStyle Base RN View style
onUndoRedoChange (undoRedo: {canUndo: boolean; canRedo: boolean}) => void Check ability undo/redo

Methods

Name Type Description
.showToolbar() () => void Show Toolbar
.hideToolbar() () => void Hide Toolbar
.undo() () => void Reverse the last action
.redo() () => void Reapply previously undone action
.getDrawingBase64() (onComplete: (base64: string) => void) => void Get Base64 image

Contributing

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

License

MIT


Made with create-react-native-library