Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Ieasemusic | 8,651 | 9 months ago | 143 | mit | JavaScript | |||||
网易云音乐第三方 | ||||||||||
Wifi Card | 6,376 | a month ago | 2 | mit | JavaScript | |||||
📶 Print a QR code for connecting to your WiFi (wificard.io) | ||||||||||
React Native Vision Camera | 5,420 | 113 | 10 hours ago | 113 | November 23, 2023 | 128 | mit | Swift | ||
📸 A powerful, high-performance React Native Camera library. | ||||||||||
Qrbtf | 5,228 | 3 months ago | 26 | gpl-3.0 | JavaScript | |||||
An art QR code (qrcode) beautifier. 艺术二维码生成器。https://qrbtf.com | ||||||||||
Qrcode.react | 3,527 | 1,254 | 911 | 16 days ago | 26 | June 25, 2022 | 34 | other | TypeScript | |
A <QRCode/> component for use with React. | ||||||||||
React Native Qrcode Scanner | 1,986 | 171 | 26 | 7 months ago | 51 | February 11, 2022 | 123 | mit | JavaScript | |
A QR code scanner component for React Native. | ||||||||||
React Qr Reader | 1,070 | 3 | a day ago | 7 | November 20, 2023 | 136 | mit | TypeScript | ||
React component for reading QR codes from webcam. | ||||||||||
React Native Qrcode Svg | 975 | 94 | 60 | 7 days ago | 36 | January 19, 2023 | 32 | mit | JavaScript | |
A QR Code generator for React Native based on react-native-svg and node-qrcode. | ||||||||||
React Native Qrcode | 845 | 280 | 21 | 2 years ago | 27 | July 25, 2018 | 49 | mit | JavaScript | |
a minimalist qrcode component for react-native | ||||||||||
React Native Qrcode Scanner View | 677 | 2 | 3 years ago | 3 | January 08, 2018 | 15 | apache-2.0 | JavaScript | ||
A highly customizable QR code scanning component for React Native |
A React component to generate QR codes for rendering to the DOM.
npm install qrcode.react
qrcode.react
exports three components, supporting rendering as SVG or Canvas. SVG is generally recommended as it is more flexible, but Canvas may be preferable.
All examples are shown using modern JavaScript modules and syntax. CommonJS require('qrcode.react')
is also supported.
QRCodeSVG
import ReactDOM from 'react-dom';
import {QRCodeSVG} from 'qrcode.react';
ReactDOM.render(
<QRCodeSVG value="https://reactjs.org/" />,
document.getElementById('mountNode')
);
QRCodeCanvas
import ReactDOM from 'react-dom';
import {QRCodeCanvas} from 'qrcode.react';
ReactDOM.render(
<QRCodeCanvas value="https://reactjs.org/" />,
document.getElementById('mountNode')
);
prop | type | default value | note |
---|---|---|---|
value |
string |
||
size |
number |
128 |
|
bgColor |
string |
"#FFFFFF" |
CSS color |
fgColor |
string |
"#000000" |
CSS color |
level |
string ('L' 'M' 'Q' 'H' ) |
'L' |
|
minVersion |
number (1-40) |
1 |
QR Code versions are 1-40. The optimal (lowest) version is determined for the value provided, using this minimum as the lower bound. |
includeMargin |
boolean |
false |
DEPRECATED. This is being remvoed in favor of marginSize
|
marginSize |
number |
0 |
Specifies the number of modules to use for margin around the symbol. The QR Code specification requires 4 , however you may use other values. Values will be turned to integers with Math.floor . Overrides includeMargin default value when specified |
imageSettings |
object |
See below |
imageSettings
field | type | default value | note |
---|---|---|---|
src |
string |
||
x |
number |
none | Will attempt to center if not specified |
y |
number |
none | Will attempt to center if not specified |
height |
number |
10% of size
|
|
width |
number |
10% of size
|
|
excavate |
boolean |
false |
|
opacity |
number |
1 |
qrcode.react
will pass through any additional props to the underlying DOM node (<svg>
or <canvas>
). This allows the use of inline style
or custom className
to customize the rendering. One common use would be to support a responsive layout.
Note: In order to render QR Codes in <canvas>
on high density displays, we scale the canvas element to contain an appropriate number of pixels and then use inline styles to scale back down. We will merge any additional styles, with custom height
and width
overriding our own values. This allows scaling to percentages but if scaling beyond the size
, you will encounter blurry images. I recommend detecting resizes with something like react-measure to detect and pass the appropriate size when rendering to <canvas>
.
qrcode.react
supports encoding text only, in a single segment. The encoding library being used does minimal detection to determine if the text being encoded can follow an optimized path for Numeric or Alphanumeric modes, allowing for more data to be encoded. Otherwise, it will encode following Byte mode. This mode includes supports multi-byte Unicode characters such as Kanji, however it does not support the optimized Kanji encoding mode.
qrcode.react
is licensed under the ISC license.
qrcode.react
bundles QR Code Generator, which is available under the MIT license.