JSPM

sketchia

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q19625F
  • License MIT

a canvas library using react-native-skia

Package Exports

  • sketchia

Readme

sketchia

It is a canvas library using react-native-skia.

features:

  • background image or plain background color.
  • 2 drawing modes-
    • cubic: for smoother curves
    • quadratic: for less smoother curves at lower computational cost
  • customizable stroke color & thickness
  • basic undo/clear etc.
  • saving transparent snapshots

Installation

# npm
npm install sketchia
#yarn
yarn add sketchia

Usage

import { type CanvasControls, SketchiaCanvas } from 'sketchia';
import { useImage } from '@shopify/react-native-skia';

const backgroundImage = useImage('https://picsum.photos/800');
const sketchCanvasRef = useRef<CanvasControls>(null);

return (
    <SketchiaCanvas
        backgroundImage={image}
        canvasColor={'#2A0F4C'}
        mode={'quadratic'}
        onStrokeStart={onStrokeStart}
        onStrokeEnd={onStrokeEnd}
        ref={sketchCanvasRef}
        strokeWeight={6}
        toolColor={'#FCFADA'}
        touchEnabled={isHighlighterActive}
    />
);

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