JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 523
  • Score
    100M100P100Q108715F
  • License MIT

Simple and powerful QR code generator (SVG only) for Angular

Package Exports

  • @larscom/ng-qrcode-svg
  • @larscom/ng-qrcode-svg/package.json

Readme

@larscom/ng-qrcode-svg

npm-version npm license CodeQL npm-publish firebase-hosting

Simple and powerful QR code generator (SVG only) for Angular.

Demo GIF

Live Demo

Installation

npm install @larscom/ng-qrcode-svg

Usage

  1. Import module QrcodeSvgModule
import { NgModule } from '@angular/core';
import { QrcodeSvgModule } from '@larscom/ng-qrcode-svg';

@NgModule({
  imports: [
    QrcodeSvgModule // <-- import
  ]
})
export class MyModule {}
  1. Use the qrcode-svg component which will render a QR code in SVG format
<qrcode-svg value="hello world!"></qrcode-svg>

Component Properties

Name Description Default
@Input() value: string; The value to encode (turns into QR code) undefined
@Input() ecc: 'low' | 'medium' | 'quartile' | 'high'; Error correction level medium
@Input() borderSize: number; The padding between the edge and the QR code (quiet zone) 2
@Input() size: string | number; The size of the QR code SVG (px,em,rem) 250
@Input() backgroundColor: string; The 'path' color (background) #FFFFFF
@Input() foregroundColor: string; The 'rect' color (foreground) #000000
@Input() alt: string | undefined; HTML alt attribute undefined
@Input() ariaLabel: string | undefined; HTML aria-label attribute undefined