react-native-signature-capture-fabric
TypeScript icon, indicating that this package has built-in type declarations

0.1.12 • Public • Published

react-native-signature-capture-fabric

capture signature for react native

Installation

npm install react-native-signature-capture-fabric

Usage

import { SignatureCaptureComponent } from 'react-native-signature-capture-fabric';

// ...

export default function App() {
  const signatureCaptureComponentRef =
    React.useRef<SignatureCaptureComponent>(null);
  return (
    <ScrollView style={styles.container} centerContent>
      <SignatureCaptureComponent
        ref={signatureCaptureComponentRef}
        backgroundColor="#ffffff"
        signatureFontSize={10}
        strokeColor="#362233"
        style={styles.box}
        onSaveEvent={(saveEventResult) => {
          console.log(
            'result dataImage',
            saveEventResult.nativeEvent.dataImage
          );
          console.log(
            'result imagePath',
            saveEventResult.nativeEvent.imagePath
          );
        }}
      />
      <TouchableOpacity
        style={styles.button}
        onPress={() => {
          signatureCaptureComponentRef.current?.save();
        }}
      >
        <Text>Save</Text>
      </TouchableOpacity>
      <TouchableOpacity
        style={styles.button}
        onPress={() => {
          signatureCaptureComponentRef.current?.reset();
        }}
      >
        <Text>Reset</Text>
      </TouchableOpacity>
    </ScrollView>
  );
}

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

Package Sidebar

Install

npm i react-native-signature-capture-fabric

Weekly Downloads

2

Version

0.1.12

License

MIT

Unpacked Size

58.9 kB

Total Files

40

Last publish

Collaborators

  • thaitd0396
  • petervu