SVG QR Code Generator In JavaScript

Category: Javascript | July 11, 2022
Views Total:1,454 views
Official Page:Go to website
Last Update:July 11, 2022


SVG QR Code Generator In JavaScript


A feature-rich, cross-platform SVG QR code generator for both node.js and browser.

How to use it:

1. Install and download.

$ npm i qrcode-svg-ts

2. Import the qrcode-svg-ts.

var QRCode = require("qrcode-svg-ts");
// OR
<script src="./dist/qrcode-svg-ts.min.js"></script>

3. Generate an SVG QR Code.

var svg = new QRCode("CSS Script").svg();

4. Available options to customize the QR Code.

var qrcode = new QRCode({
    content: "CSS Script",
    padding: 0,
    width: 256,
    height: 256,
    typeNumber: 4,
    color: "#000000",
    background: "#ffffff",
    ecl: "H", // L, M, H, Q
    join: true,
    predefined: false,
    pretty: true,
    swap: false, // swap X and Y modules
    xmlDeclaration: true, // prepend XML declaration to the SVG document
    container: 'svg', // wrapping element

5. Save the QR Code."sample.svg").then(() => {

You Might Be Interested In:

Leave a Reply