Gathering detailed insights and metrics for react-native-circle-qrcode-svg
Gathering detailed insights and metrics for react-native-circle-qrcode-svg
Gathering detailed insights and metrics for react-native-circle-qrcode-svg
Gathering detailed insights and metrics for react-native-circle-qrcode-svg
A QR Code generator for React Native based on react-native-svg and node-qrcode.
npm install react-native-circle-qrcode-svg
Typescript
Module System
Node Version
NPM Version
JavaScript (48.32%)
TypeScript (17.49%)
Ruby (10.31%)
Objective-C (8.7%)
Kotlin (8.47%)
Objective-C++ (6.72%)
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
3,569
Last Day
1
Last Week
13
Last Month
77
Last Year
533
MIT License
1,127 Stars
352 Commits
225 Forks
44 Watchers
14 Branches
186 Contributors
Updated on Aug 25, 2025
Latest Version
6.1.12
Package Id
react-native-circle-qrcode-svg@6.1.12
Unpacked Size
156.51 kB
Size
91.07 kB
File Count
20
NPM Version
6.14.16
Node Version
16.14.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
550%
13
Compared to previous week
Last Month
196.2%
77
Compared to previous month
Last Year
47.6%
533
Compared to previous year
2
3
A QR Code generator for React Native based on react-native-svg and javascript-qrcode.
Discussion: https://discord.gg/RvFM97v
Android | iOS |
---|---|
![]() | ![]() |
Install dependency packages
1yarn add react-native-svg react-native-qrcode-svg
Or
1npm i -S react-native-svg react-native-qrcode-svg
If you are using React Native 0.60.+
go to the folder your-project/ios and run pod install
, and you're done.
If not, use one of the following method to link.
react-native link
If you are using React Native <= 0.59.X
, link the native project:
1react-native link react-native-svg
1import QRCode from 'react-native-qrcode-svg'; 2 3// Simple usage, defaults for all but the value 4render() { 5 return ( 6 <QRCode 7 value="http://awesome.link.qr" 8 /> 9 ); 10};
1// 30px logo from base64 string with transparent background 2render() { 3 let base64Logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAA..'; 4 return ( 5 <QRCode 6 value="Just some string value" 7 logo={{uri: base64Logo}} 8 logoSize={30} 9 logoBackgroundColor='transparent' 10 /> 11 ); 12};
1// 20% (default) sized logo from local file string with white logo backdrop 2render() { 3 let logoFromFile = require('../assets/logo.png'); 4 return ( 5 <QRCode 6 value="Just some string value" 7 logo={logoFromFile} 8 /> 9 ); 10};
1// get base64 string encode of the qrcode (currently logo is not included) 2getDataURL() { 3 this.svg.toDataURL(this.callback); 4} 5 6callback(dataURL) { 7 console.log(dataURL); 8} 9 10render() { 11 return ( 12 <QRCode 13 value="Just some string value" 14 getRef={(c) => (this.svg = c)} 15 /> 16 ); 17}
Name | Default | Description |
---|---|---|
size | 100 | Size of rendered image in pixels |
value | 'this is a QR code' | String Value of the QR code. Can also accept an array of segments as defined in Manual mode. Ex. [{ data: 'ABCDEFG', mode: 'alphanumeric' }, { data: '0123456', mode: 'numeric' }, { data: [253,254,255], mode: 'byte' }] |
color | 'black' | Color of the QR code |
backgroundColor | 'white' | Color of the background |
enableLinearGradient | false | enables or disables linear gradient |
linearGradient | ['rgb(255,0,0)','rgb(0,255,255)'] | array of 2 rgb colors used to create the linear gradient |
gradientDirection | [170,0,0,0] | the direction of the linear gradient |
logo | null | Image source object. Ex. {uri: 'base64string'} or {require('pathToImage')} |
logoSize | 20% of size | Size of the imprinted logo. Bigger logo = less error correction in QR code |
logoBackgroundColor | backgroundColor | The logo gets a filled quadratic background with this color. Use 'transparent' if your logo already has its own backdrop. |
logoMargin | 2 | logo's distance to its wrapper |
logoBorderRadius | 0 | the border-radius of logo image (Android is not supported) |
quietZone | 0 | quiet zone around the qr in pixels (useful when saving image to gallery) |
getRef | null | Get SVG ref for further usage |
ecl | 'M' | Error correction level |
onError(error) | undefined | Callback fired when exception happened during the code generating process |
Note: Experimental only ( not tested on iOS) , uses getRef() and needs RNFS module
npm install --save react-native-fs
1import { CameraRoll , ToastAndroid } from "react-native" 2import RNFS from "react-native-fs" 3... 4 5 saveQrToDisk() { 6 this.svg.toDataURL((data) => { 7 RNFS.writeFile(RNFS.CachesDirectoryPath+"/some-name.png", data, 'base64') 8 .then((success) => { 9 return CameraRoll.saveToCameraRoll(RNFS.CachesDirectoryPath+"/some-name.png", 'photo') 10 }) 11 .then(() => { 12 this.setState({ busy: false, imageSaved: true }) 13 ToastAndroid.show('Saved to gallery !!', ToastAndroid.SHORT) 14 }) 15 }) 16 }
If you like this project, please consider buy me a coffee :)
No vulnerabilities found.