1.1.10 • Published 8 months ago

react-native-svg-qrcode v1.1.10

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-native-svg-qrcode

A minimal dependency QR Code generator for React Native which works across iOS, Android and Web.

Based on react-native-qrcode-svg but without any dependencies and just a single peer dependency - react-native-svg.

Perfect for folks who already use react-native-svg in their project and want QR code functionality without bloating their bundle size.

Written in TypeScript.

Installation

yarn add react-native-svg react-native-qrcode-svg

Usage

const QR_CODE_SIZE = 262;
const QR_LOGO_SIZE = 70;

const App = () => {
  return (
    <View style={styles.container}>
      <QRCode
        size={QR_CODE_SIZE}
        value={'insert address'}
        logo={require('../assets/black_r_logo.png')}
        logoSize={QR_LOGO_SIZE}
      />
    </View>
  );
};

Props

NameDefaultDescription
size100Size of rendered image in pixels
value'this is a QR code'Value of the QR code.
color'black'Color of the QR code
backgroundColor'white'Color of the background
enableLinearGradientfalseenables or disables linear gradient
linearGradient'rgba(0, 73, 255, 1)', 'rgba(255, 255, 255, 1)'array of 2 rgb colors used to create the linear gradient
gradientDirection170,0,0,0the direction of the linear gradient
logonullImage source object. Ex. {uri: 'base64string'} or {require('pathToImage')}
logoSize20% of sizeSize of the imprinted logo. Bigger logo = less error correction in QR code
logoBackgroundColorbackgroundColorThe logo gets a filled quadratic background with this color. Use 'transparent' if your logo already has its own backdrop.
logoMargin2logo's distance to its wrapper
logoBorderRadius0the border-radius of logo image (Android is not supported)
quietZone0quiet zone around the qr in pixels (useful when saving image to gallery)
ecl'M'Error correction level
onError(error)undefinedCallback fired when exception happened during the code generating process

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

1.1.10

8 months ago

1.1.9

8 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.0.10

8 months ago

1.0.8

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.1

8 months ago