Animated Scanner

January 16, 2023 ยท View on GitHub

AnimatedScanner component gives animation to user when they scan any document, QR code etc.

๐ŸŽฌ Preview


AnimatedScanner
alt tag

Default Usage


import React from 'react';
import { StyleSheet, View } from 'react-native';
import { AnimatedScanner } from 'react-native-skia-catalog';

const AnimatedScannerScreen = () => (
  <View style={styles.container}>
    <AnimatedScanner />
  </View>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default AnimatedScannerScreen;

Custom Usage


import React from 'react';
import { StyleSheet, View } from 'react-native';
import { AnimatedScanner } from 'react-native-skia-catalog';

const AnimatedScannerScreen = () => (
  <View style={styles.container}>
    <AnimatedScanner
      height={350}
      borderColor={'#000000'}
      borderWidth={8}
      borderRadius={50}
      strokeWidth={250}
    />
  </View>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default AnimatedScannerScreen;

๐ŸŽฌ Custom Usage Preview


alt tag

Properties

PropsDefaultTypeDescription
stopZoomingfalsebooleanstopZooming to stop outer zooming in Animated Scanner.
initialZoomScale0.9numberinitialZoomScale use for outer zooming effect.
height200numberheight of AnimatedScanner.
zoomingDelay800numberzoomingDelay use for outer zoomingDelay.
borderColor#01579BstringborderColor use to give color for outer zooming line.
borderRadius10numberborderRadius to set outer line border.
borderWidth2numberborderWidth set outer line borderWidth.
strokeColor#FF0000stringColor of the vertical animated line.
strokeDelay1400numberstrokeDelay delay in vertical animation.
strokeWidth240numberstrokeWidth increase and decrease width of vertical animated line.

Note: initialZoomScale has a scale from 0 to 1. When the scale value is set to 1, zooming will stop and when it is set to 0, zooming will begin from the centre.

๐ŸŽฌ Preview Example


Animated Scanner