All Projects → no23reason → React Qr Svg

no23reason / React Qr Svg

Licence: mit
React component for rendering SVG QR codes

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Qr Svg

Qr Ascii
A small library to generate QR codes with ascii
Stars: ✭ 63 (-52.99%)
Mutual labels:  qr-code, qrcode-generator, qr, qrcode
Awesome Qr.js
An awesome QR code generator written in JavaScript.
Stars: ✭ 1,247 (+830.6%)
Mutual labels:  qr-code, qrcode-generator, qr, qrcode
Php Qrcode
A QR Code generator for PHP7.4+
Stars: ✭ 685 (+411.19%)
Mutual labels:  qr-code, qrcode-generator, svg, qrcode
Qrbtf
An art QR code (qrcode) beautifier. 艺术二维码生成器。https://qrbtf.com
Stars: ✭ 1,391 (+938.06%)
Mutual labels:  qr-code, qrcode-generator, qr, qrcode
nova-qrcode-field
A Laravel Nova field to generate QR Code
Stars: ✭ 28 (-79.1%)
Mutual labels:  qrcode, qr-code, qr, qrcode-generator
Ngx Kjua
Angular QR-Code generator component using kjua.
Stars: ✭ 51 (-61.94%)
Mutual labels:  qr-code, qrcode-generator, qrcode
pix-payload-generator.net
Gerar payload para qrcode estático PIX. (Sistema de pagamento instantâneo do Brasil) Sem a necessidade de conexão com um PSP.
Stars: ✭ 23 (-82.84%)
Mutual labels:  qrcode, qr, qrcode-generator
Qr Code Scanner
📠 A simple, fast and useful progressive web application
Stars: ✭ 982 (+632.84%)
Mutual labels:  qr-code, qr, qrcode
qrcode
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
Stars: ✭ 69 (-48.51%)
Mutual labels:  qrcode, qr-code, qr
QR Attendance
This project is an attendance system which provides attendance on scanning QR code. The attendance is stored in Excel sheet named with the date of attendance taken. In this folder a file named Generate.py is used to generate the QR code for given input file. Attend.py file is for scanning the QR code
Stars: ✭ 17 (-87.31%)
Mutual labels:  qrcode, qr-code, qrcode-generator
Qrcode
QR-code encoder/decoder (no image recognition)
Stars: ✭ 34 (-74.63%)
Mutual labels:  qr-code, qrcode-generator, qrcode
Qr Code
Web Component for generating QR codes
Stars: ✭ 425 (+217.16%)
Mutual labels:  qr-code, qr, qrcode
quagga2-reader-qr
Quagga2 sample external reader for QR codes
Stars: ✭ 20 (-85.07%)
Mutual labels:  qrcode, qr-code, qr
art-qr
JavaScript library to generate beautiful QR code in browser 艺术二维码
Stars: ✭ 19 (-85.82%)
Mutual labels:  qrcode, qr, qrcode-generator
Qrcode
💮 amazing QRCode generator in Python (supporting animated gif) - Python amazing 二维码生成器(支持 gif 动态图片二维码)
Stars: ✭ 8,613 (+6327.61%)
Mutual labels:  qrcode, qr-code, qrcode-generator
wifiqr
Create a QR code with your Wi-Fi login details
Stars: ✭ 207 (+54.48%)
Mutual labels:  qrcode, qr, qrcode-generator
js-qrcode
The library is for generating QR codes like SVG, HTML5 Canvas, PNG and JPG files, or text.
Stars: ✭ 35 (-73.88%)
Mutual labels:  qrcode, qr, qrcode-generator
vk-qr
VK QR Code generator library
Stars: ✭ 43 (-67.91%)
Mutual labels:  qrcode, qr-code, qr
qr
🔲 Generate QR Codes straight in your terminal!
Stars: ✭ 34 (-74.63%)
Mutual labels:  qrcode, qr, qrcode-generator
Qrious
Pure JavaScript library for QR code generation using canvas
Stars: ✭ 1,160 (+765.67%)
Mutual labels:  qrcode-generator, qr, qrcode

Node.js CI npm version Commitizen friendly semantic-release

react-qr-svg

React component for rendering SVG QR codes

Demo

Basic demo can be found at the demo page.

Why SVG?

Most of the existing React components for QR (namely qrcode.react, which was used as a starting point for this project) use <canvas> for rendering.

This is fine for most scenarios, however when trying to print such code, it gets blurry. This is caused by the fact that <canvas> contents get rastered and then scaled in the process resulting in the blurriness.

On the other hand, SVG retains the vector information of its contents and therefore is scaled properly when printed.

Basic Usage

Install using npm:

npm install react-qr-svg --save

Then use in your application like this:

import React from "react";
import { QRCode } from "react-qr-svg";

class Demo extends React.Component {
    render() {
        return (
            <QRCode
                bgColor="#FFFFFF"
                fgColor="#000000"
                level="Q"
                style={{ width: 256 }}
                value="some text"
            />
        );
    }
}

Props

The props available are (shown with default values):

{
    value: '', // The value to encode in the code
    level: 'L', // QR Error correction level
    bgColor: '#FFFFFF', // Color of the bright squares
    fgColor: '#000000', // Color of the dark squares
    cellClassPrefix: '', // Prefix of the CSS classes, if specified, bgColor and fgColor are ignored
}

The level prop corresponds to Error correction level so the valid values are L, M, Q and H.

You can also specify all the props that are valid for the <svg> React element (e.g. style, className or width which you can use to specify the size of the QR code).

CSS styling

You can use CSS to set the QR code colors instead of the bgColor and fgColor props. You just need to specify the cellClassPrefix prop and three CSS classes will become available for you to style.

Let's say you used my-qr-code as the cellClassPrefix. The generated classes are:

  • my-qr-code-cell for all the cells
  • my-qr-code-cell-empty for the empty cells
  • my-qr-code-cell-filled for the filled cells

You can then set the colors using the fill CSS property. See CSS Demo for an example.

Note: If you specify cellClassPrefix, bgColor and fgColor values are ignored.

Acknowledgements

This project is heavily inspired by the qrcode.react project.

This project uses the react-component-boilerplate.

License

react-qr-svg is available under MIT. See LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].