1.0.0 • Published 2 years ago

@ankipro/react-native-canvas-view v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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.

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

NameTypeDescription
refCanvasViewRefSee methods below
styleViewStyleBase RN View style
onUndoRedoChange(undoRedo: {canUndo: boolean; canRedo: boolean}) => voidCheck ability undo/redo

Methods

NameTypeDescription
.showToolbar()() => voidShow Toolbar
.hideToolbar()() => voidHide Toolbar
.undo()() => voidReverse the last action
.redo()() => voidReapply previously undone action
.getDrawingBase64()(onComplete: (base64: string) => void) => voidGet 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

1.0.0

2 years ago