Skip to main content

Migrate from react-native-signature-canvas

- import SignatureScreen from 'react-native-signature-canvas';
+ import { SignaturePad, signatureToSvg } from 'patine-ui';

- <SignatureScreen ref={ref} onOK={(dataUrl) => upload(dataUrl)} onEmpty={warn} descriptionText="Sign" penColor="#111" />
+ <SignaturePad value={strokes} onValueChange={setStrokes} strokeColor="#111" labels={{ placeholder: 'Sign' }} />
+ <Button onPress={() => upload(signatureToSvg(strokes, { width, height }))}>Save</Button>
react-native-signature-canvasPatine UI
onOK(dataUrl) (PNG)signatureToSvg(strokes, { width, height }) (SVG) or signatureToPath(strokes)
onEmptyisSignatureEmpty(strokes)
ref.clearSignature()setStrokes([]), or the built-in Clear button
ref.undo()setStrokes(strokes.slice(0, -1))
penColor / minWidth / maxWidthstrokeColor / strokeWidth
descriptionText / clearTextlabels.placeholder / labels.clear
onBegin / onEndonBegin / onEnd
webStylestyle and the design

There's no WebView: SignaturePad draws with plain views and keeps the strokes as points, which you can store and draw again exactly. For a PNG, render the SVG with your image tooling.

See all migration guides for other libraries, and Comparison for when another library is the better choice.