0.3.6 • Published 3 years ago

react-native-signing-field v0.3.6

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

react-native-signing-field

This library implements a signing field and a display signing feature for react native, where in the signing field will generate a SVG path of the signature and can be used as props to display it on a non-editable field.

Installation

React-Native-SVG

This Library needs react-native-svg installed and configured.

Using Expo projects you don't need to install it first otherwise check the steps to install react-native-svg in the library docs first.

Installing

yarn add react-native-signing-field

and on iOS

npx pod-install

Usage

See the example app here.

import * as React from 'react';
//...
import {
  SigningField,
  SigningDisplay,
  SigningPathType,
} from 'react-native-signing-field';

export default function App() {
  const [signing, setSigning] = React.useState<SigningPathType>([]);

  return (
    <View style={styles.container}>
      <Text> Signing Field </Text>
      <SigningField
        style={styles.signingField}
        setSigning={setSigning}
        // resetFieldButton={<Text>RESET</Text>} -- allows user to define the reset button
      />
      <Text> Signing Being Displayed </Text>
      <SigningDisplay
        signing={signing}
        style={styles.signingDisplay}
        strokeWidth={1}
      />
    </View>
  );
}

Gravação de Tela 2023-01-20 às 16 42 32 2023-01-20 17_00_58

Props

SigningField

PropTypeDescription
setSigningfunctionFunction that gets SigningPathType as argument, ideally to set the SigningPath on a HOC
styleobjectStyle of the wrapping view, default is width: 300 , height: 100, borderWidth: 1
strokeColorstringColor of the stroke, it can be any RGB color, default is black
strokeWidthnumberWidth of the stroke, default is 2
resetFieldButtonReact NodeComponent that will replace the reset button, it can be any other component or string.

SigningDisplay

PropTypeDescription
signingSigningPathTypeValue of the path to be displayed in the SigningDisplay component.
styleobjectStyle of the wrapping view, default is width: 300 , height: 200
strokeColorstringColor of the stroke, it can be any RGB color, default is black
strokeWidthnumberWidth of the stroke, default is 2

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

0.3.6

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago